org.jasig.services.persondir.support.jdbc
Class SingleRowJdbcPersonAttributeDao

java.lang.Object
  extended by org.jasig.services.persondir.support.BasePersonAttributeDao
      extended by org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
          extended by org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
              extended by org.jasig.services.persondir.support.AbstractQueryPersonAttributeDao<org.jasig.services.persondir.support.jdbc.PartialWhereClause>
                  extended by org.jasig.services.persondir.support.jdbc.AbstractJdbcPersonAttributeDao<Map<String,Object>>
                      extended by org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao
All Implemented Interfaces:
IPersonAttributeDao

public class SingleRowJdbcPersonAttributeDao
extends AbstractJdbcPersonAttributeDao<Map<String,Object>>

An IPersonAttributeDao implementation that maps from column names in the result of a SQL query to attribute names.
You must set a Map from column names to attribute names and only column names appearing as keys in that map will be used.

Configuration:

Property Description Required Default
columnsToAttributes The Map of String columns names to String or Sets of Strings to use as attribute names in the returned Map. If a column name is not in the map the column name will be used in as the returned attribute name. No Collections.EMPTY_MAP

Since:
uPortal 2.5
Version:
$Revision$ $Date$
Author:
andrew.petro@yale.edu, Eric Dalquist

Field Summary
 
Fields inherited from class org.jasig.services.persondir.support.BasePersonAttributeDao
logger
 
Fields inherited from interface org.jasig.services.persondir.IPersonAttributeDao
WILDCARD, WILDCARD_PATTERN
 
Constructor Summary
SingleRowJdbcPersonAttributeDao(DataSource ds, String sql)
          Creates a new MultiRowJdbcPersonAttributeDao specifying the DataSource and SQL to use.
 
Method Summary
protected  org.springframework.jdbc.core.simple.ParameterizedRowMapper<Map<String,Object>> getRowMapper()
           
protected  List<IPersonAttributes> parseAttributeMapFromResults(List<Map<String,Object>> queryResults, String queryUserName)
          Takes the List from the query and parses it into the List of IPersonAttributes attributes to be returned.
 
Methods inherited from class org.jasig.services.persondir.support.jdbc.AbstractJdbcPersonAttributeDao
appendAttributeToQuery, getPeopleForQuery, getQueryTemplate, getQueryType, setQueryType
 
Methods inherited from class org.jasig.services.persondir.support.AbstractQueryPersonAttributeDao
generateQuery, getAvailableQueryAttributes, getConfiguredUserNameAttribute, getPeopleWithMultivaluedAttributes, getPossibleUserAttributeNames, getQueryAttributeMapping, getResultAttributeMapping, getUnmappedUsernameAttribute, isRequireAllQueryAttributes, isUseAllQueryAttributes, mapPersonAttributes, setQueryAttributeMapping, setRequireAllQueryAttributes, setResultAttributeMapping, setUnmappedUsernameAttribute, setUseAllQueryAttributes
 
Methods inherited from class org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
getPerson, getUsernameAttributeProvider, setUsernameAttributeProvider, toSeedMap
 
Methods inherited from class org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
getPeople, toMultivaluedSeed
 
Methods inherited from class org.jasig.services.persondir.support.BasePersonAttributeDao
flattenResults, getMultivaluedUserAttributes, getMultivaluedUserAttributes, getUserAttributes, getUserAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleRowJdbcPersonAttributeDao

public SingleRowJdbcPersonAttributeDao(DataSource ds,
                                       String sql)
Creates a new MultiRowJdbcPersonAttributeDao specifying the DataSource and SQL to use.

Parameters:
ds - The DataSource to get connections from for executing queries, may not be null.
attrList - Sets the query attribute list
sql - The SQL to execute for user attributes, may not be null.
Method Detail

getRowMapper

protected org.springframework.jdbc.core.simple.ParameterizedRowMapper<Map<String,Object>> getRowMapper()
Specified by:
getRowMapper in class AbstractJdbcPersonAttributeDao<Map<String,Object>>
Returns:
The ParameterizedRowMapper to handle the results of the SQL query.

parseAttributeMapFromResults

protected List<IPersonAttributes> parseAttributeMapFromResults(List<Map<String,Object>> queryResults,
                                                               String queryUserName)
Description copied from class: AbstractJdbcPersonAttributeDao
Takes the List from the query and parses it into the List of IPersonAttributes attributes to be returned.

Specified by:
parseAttributeMapFromResults in class AbstractJdbcPersonAttributeDao<Map<String,Object>>
Parameters:
queryResults - Results from the query.
queryUserName - The username passed in the query map, if no username attribute existed in the query Map null is provided.
Returns:
The results of the query


Copyright © 2012 Jasig. All Rights Reserved.