public abstract class AbstractJdbcPersonAttributeDao<R> extends AbstractQueryPersonAttributeDao<org.jasig.services.persondir.support.jdbc.PartialWhereClause>
| Property | Description | Required | Default |
|---|---|---|---|
| queryType | How multiple attributes in a query should be concatenated together. The other option is OR. | No | AND |
DEFAULT_CASE_CANONICALIZATION_MODE, DEFAULT_USERNAME_CASE_CANONICALIZATION_MODEloggerWILDCARD, WILDCARD_PATTERN| Constructor and Description |
|---|
AbstractJdbcPersonAttributeDao() |
AbstractJdbcPersonAttributeDao(DataSource ds,
String queryTemplate) |
| Modifier and Type | Method and Description |
|---|---|
protected org.jasig.services.persondir.support.jdbc.PartialWhereClause |
appendAttributeToQuery(org.jasig.services.persondir.support.jdbc.PartialWhereClause queryBuilder,
String dataAttribute,
List<Object> queryValues)
Append the attribute and value to the queryBuilder.
|
protected String |
canonicalizeDataAttributeForSql(String dataAttribute)
Canonicalize the data-layer attribute column with the given name via
SQL function.
|
Map<String,CaseCanonicalizationMode> |
getCaseInsensitiveDataAttributes() |
Map<CaseCanonicalizationMode,MessageFormat> |
getDataAttributeCaseCanonicalizationFunctions() |
protected List<IPersonAttributes> |
getPeopleForQuery(org.jasig.services.persondir.support.jdbc.PartialWhereClause queryBuilder,
String queryUserName)
Executes the query for the generated queryBuilder object and returns a list where each entry is a Map of
attributes for a single IPersonAttributes.
|
String |
getQueryTemplate() |
QueryType |
getQueryType() |
protected abstract org.springframework.jdbc.core.simple.ParameterizedRowMapper<R> |
getRowMapper() |
protected abstract List<IPersonAttributes> |
parseAttributeMapFromResults(List<R> queryResults,
String queryUserName)
Takes the
List from the query and parses it into the List of IPersonAttributes attributes to be returned. |
void |
setCaseInsensitiveDataAttributes(Map<String,CaseCanonicalizationMode> caseInsensitiveDataAttributes) |
void |
setCaseInsensitiveDataAttributesAsCollection(Collection<String> caseInsensitiveDataAttributes) |
void |
setDataAttributeCaseCanonicalizationFunctions(Map<CaseCanonicalizationMode,MessageFormat> dataAttributeCaseCanonicalizationFunctions)
Assign
MessageFormats describing how to wrap a JDBC/SQL column
reference in a function corresponding to a given
CaseCanonicalizationMode. |
void |
setQueryType(QueryType queryType)
Type of logical operator to use when joining WHERE clause components
|
appendCanonicalizedAttributeToQuery, 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 AbstractJdbcPersonAttributeDao()
public AbstractJdbcPersonAttributeDao(DataSource ds, String queryTemplate)
ds - The DataSource to use for queriesqueryTemplate - Template to use for SQL query generation. Use {0} as the placeholder for where the generated portion of the WHERE clause should be inserted.public String getQueryTemplate()
public QueryType getQueryType()
public void setQueryType(QueryType queryType)
queryType - the queryType to setprotected abstract List<IPersonAttributes> parseAttributeMapFromResults(List<R> queryResults, String queryUserName)
List from the query and parses it into the List of IPersonAttributes attributes to be returned.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.protected abstract org.springframework.jdbc.core.simple.ParameterizedRowMapper<R> getRowMapper()
protected org.jasig.services.persondir.support.jdbc.PartialWhereClause appendAttributeToQuery(org.jasig.services.persondir.support.jdbc.PartialWhereClause queryBuilder, String dataAttribute, List<Object> queryValues)
AbstractQueryPersonAttributeDaoappendAttributeToQuery in class AbstractQueryPersonAttributeDao<org.jasig.services.persondir.support.jdbc.PartialWhereClause>queryBuilder - The sub-class specific query builder objectdataAttribute - The full attribute name to appendqueryValues - The values for the data attributeprotected String canonicalizeDataAttributeForSql(String dataAttribute)
dataAttribute - Name of the data attribute columnprotected List<IPersonAttributes> getPeopleForQuery(org.jasig.services.persondir.support.jdbc.PartialWhereClause queryBuilder, String queryUserName)
AbstractQueryPersonAttributeDaogetPeopleForQuery in class AbstractQueryPersonAttributeDao<org.jasig.services.persondir.support.jdbc.PartialWhereClause>queryBuilder - The query generated by calls to AbstractQueryPersonAttributeDao.appendAttributeToQuery(Object, String, List)queryUserName - The username passed in the query map, if no username attribute existed in the query Map null is provided.public Map<String,CaseCanonicalizationMode> getCaseInsensitiveDataAttributes()
public void setCaseInsensitiveDataAttributes(Map<String,CaseCanonicalizationMode> caseInsensitiveDataAttributes)
public void setCaseInsensitiveDataAttributesAsCollection(Collection<String> caseInsensitiveDataAttributes)
public void setDataAttributeCaseCanonicalizationFunctions(Map<CaseCanonicalizationMode,MessageFormat> dataAttributeCaseCanonicalizationFunctions)
MessageFormats describing how to wrap a JDBC/SQL column
reference in a function corresponding to a given
CaseCanonicalizationMode. For example, a typical mapping for
CaseCanonicalizationMode.LOWER would be "lower({0})". The
defaults are just what you'd expect ("lower({0})" and "upper({0})").
Setting null or an empty map has the effect of never
wrapping any columns in canonicalizing functions, even if they are
referenced by setCaseInsensitiveDataAttributes(java.util.Map).
dataAttributeCaseCanonicalizationFunctions - Map of Canonicalization Mode to Message Formatterspublic Map<CaseCanonicalizationMode,MessageFormat> getDataAttributeCaseCanonicalizationFunctions()
Copyright © 2015 Jasig. All Rights Reserved.