org.jasig.services.persondir.support.jdbc
Class SingleRowJdbcPersonAttributeDao
java.lang.Object
org.jasig.services.persondir.support.BasePersonAttributeDao
org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
org.jasig.services.persondir.support.AbstractQueryPersonAttributeDao<org.jasig.services.persondir.support.jdbc.PartialWhereClause>
org.jasig.services.persondir.support.jdbc.AbstractJdbcPersonAttributeDao<Map<String,Object>>
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
| 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 listsql - The SQL to execute for user attributes, may not be null.
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.