public class MultiRowJdbcPersonAttributeDao extends AbstractJdbcPersonAttributeDao<Map<String,Object>>
IPersonAttributeDao
implementation that maps attribute names and values from name and value column
pairs. This is usefull if user attributes are stored in a table like:| USER_NM | ATTR_NM | ATTR_VL |
|---|---|---|
| jstudent | name.given | joe |
| jstudent | name.family | student |
| badvisor | name.given | bob |
| badvisor | name.family | advisor |
SingleRowJdbcPersonAttributeDao which expects
a single row result for a user query. | Property | Description | Required | Default |
|---|---|---|---|
| nameValueColumnMappings |
A Map of attribute name columns to attribute value columns. A single result row can have multiple
name columns and multiple value columns associated with each name. The values of the Map can be
either String or Collection of String.
|
Yes | null |
DEFAULT_CASE_CANONICALIZATION_MODE, DEFAULT_USERNAME_CASE_CANONICALIZATION_MODEloggerWILDCARD, WILDCARD_PATTERN| Constructor and Description |
|---|
MultiRowJdbcPersonAttributeDao() |
MultiRowJdbcPersonAttributeDao(DataSource ds,
String sql)
Creates a new MultiRowJdbcPersonAttributeDao specifying the DataSource and SQL to use.
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,Set<String>> |
getNameValueColumnMappings() |
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. |
void |
setNameValueColumnMappings(Map<String,?> nameValueColumnMap)
The
Map of columns from a name column to value columns. |
appendAttributeToQuery, canonicalizeDataAttributeForSql, getCaseInsensitiveDataAttributes, getDataAttributeCaseCanonicalizationFunctions, getPeopleForQuery, getQueryTemplate, getQueryType, setCaseInsensitiveDataAttributes, setCaseInsensitiveDataAttributesAsCollection, setDataAttributeCaseCanonicalizationFunctions, setQueryTypeappendCanonicalizedAttributeToQuery, canonicalizeAttribute, generateQuery, getAvailableQueryAttributes, getCaseCanonicalizationLocale, getCaseInsensitiveQueryAttributes, getCaseInsensitiveResultAttributes, getConfiguredUserNameAttribute, getDefaultCaseCanonicalizationMode, getPeopleWithMultivaluedAttributes, getPossibleUserAttributeNames, getQueryAttributeMapping, getResultAttributeMapping, getUnmappedUsernameAttribute, getUsernameCaseCanonicalizationMode, isRequireAllQueryAttributes, isUseAllQueryAttributes, isUserNameAttributeConfigured, mapPersonAttributes, setCaseCanonicalizationLocale, setCaseInsensitiveQueryAttributes, setCaseInsensitiveQueryAttributesAsCollection, setCaseInsensitiveResultAttributes, setCaseInsensitiveResultAttributesAsCollection, setDefaultCaseCanonicalizationMode, setQueryAttributeMapping, setRequireAllQueryAttributes, setResultAttributeMapping, setUnmappedUsernameAttribute, setUseAllQueryAttributes, setUsernameCaseCanonicalizationModegetPerson, getUsernameAttributeProvider, setUsernameAttributeProvider, toSeedMapgetPeople, toMultivaluedSeedflattenResults, getMultivaluedUserAttributes, getMultivaluedUserAttributes, getUserAttributes, getUserAttributespublic MultiRowJdbcPersonAttributeDao()
public MultiRowJdbcPersonAttributeDao(DataSource ds, String sql)
ds - The DataSource to get connections from for executing queries, may not be null.sql - The SQL to execute for user attributes, may not be null.public Map<String,Set<String>> getNameValueColumnMappings()
public void setNameValueColumnMappings(Map<String,?> nameValueColumnMap)
Map of columns from a name column to value columns. Keys are Strings,
Values are Strings or List of Strings.nameValueColumnMap - The Map of name column to value column(s).protected org.springframework.jdbc.core.simple.ParameterizedRowMapper<Map<String,Object>> getRowMapper()
getRowMapper in class AbstractJdbcPersonAttributeDao<Map<String,Object>>protected List<IPersonAttributes> parseAttributeMapFromResults(List<Map<String,Object>> queryResults, String queryUserName)
AbstractJdbcPersonAttributeDaoList from the query and parses it into the List of IPersonAttributes attributes to be returned.parseAttributeMapFromResults in class AbstractJdbcPersonAttributeDao<Map<String,Object>>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.Copyright © 2015 Jasig. All Rights Reserved.