public abstract class AbstractJdbcPersonAttributeDao<R> extends AbstractQueryPersonAttributeDao<org.apereo.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(javax.sql.DataSource ds,
java.lang.String queryTemplate) |
| Modifier and Type | Method and Description |
|---|---|
protected org.apereo.services.persondir.support.jdbc.PartialWhereClause |
appendAttributeToQuery(org.apereo.services.persondir.support.jdbc.PartialWhereClause queryBuilder,
java.lang.String dataAttribute,
java.util.List<java.lang.Object> queryValues)
Append the attribute and value to the queryBuilder.
|
protected java.lang.String |
canonicalizeDataAttributeForSql(java.lang.String dataAttribute)
Canonicalize the data-layer attribute column with the given name via
SQL function.
|
java.util.Map<java.lang.String,CaseCanonicalizationMode> |
getCaseInsensitiveDataAttributes() |
java.util.Map<CaseCanonicalizationMode,java.text.MessageFormat> |
getDataAttributeCaseCanonicalizationFunctions() |
protected java.util.List<IPersonAttributes> |
getPeopleForQuery(org.apereo.services.persondir.support.jdbc.PartialWhereClause queryBuilder,
java.lang.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.
|
java.lang.String |
getQueryTemplate() |
QueryType |
getQueryType() |
protected abstract org.springframework.jdbc.core.RowMapper<R> |
getRowMapper() |
protected abstract java.util.List<IPersonAttributes> |
parseAttributeMapFromResults(java.util.List<R> queryResults,
java.lang.String queryUserName)
Takes the
List from the query and parses it into the List of IPersonAttributes attributes to be returned. |
void |
setCaseInsensitiveDataAttributes(java.util.Map<java.lang.String,CaseCanonicalizationMode> caseInsensitiveDataAttributes) |
void |
setCaseInsensitiveDataAttributesAsCollection(java.util.Collection<java.lang.String> caseInsensitiveDataAttributes) |
void |
setDataAttributeCaseCanonicalizationFunctions(java.util.Map<CaseCanonicalizationMode,java.text.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, toMultivaluedSeedcompareTo, flattenResults, getMultivaluedUserAttributes, getMultivaluedUserAttributes, getOrder, getUserAttributes, getUserAttributes, setOrderpublic AbstractJdbcPersonAttributeDao()
public AbstractJdbcPersonAttributeDao(javax.sql.DataSource ds,
java.lang.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 java.lang.String getQueryTemplate()
public QueryType getQueryType()
public void setQueryType(QueryType queryType)
queryType - the queryType to setprotected abstract java.util.List<IPersonAttributes> parseAttributeMapFromResults(java.util.List<R> queryResults, java.lang.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.RowMapper<R> getRowMapper()
protected org.apereo.services.persondir.support.jdbc.PartialWhereClause appendAttributeToQuery(org.apereo.services.persondir.support.jdbc.PartialWhereClause queryBuilder, java.lang.String dataAttribute, java.util.List<java.lang.Object> queryValues)
AbstractQueryPersonAttributeDaoappendAttributeToQuery in class AbstractQueryPersonAttributeDao<org.apereo.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 java.lang.String canonicalizeDataAttributeForSql(java.lang.String dataAttribute)
dataAttribute - Name of the data attribute columnprotected java.util.List<IPersonAttributes> getPeopleForQuery(org.apereo.services.persondir.support.jdbc.PartialWhereClause queryBuilder, java.lang.String queryUserName)
AbstractQueryPersonAttributeDaogetPeopleForQuery in class AbstractQueryPersonAttributeDao<org.apereo.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 java.util.Map<java.lang.String,CaseCanonicalizationMode> getCaseInsensitiveDataAttributes()
public void setCaseInsensitiveDataAttributes(java.util.Map<java.lang.String,CaseCanonicalizationMode> caseInsensitiveDataAttributes)
public void setCaseInsensitiveDataAttributesAsCollection(java.util.Collection<java.lang.String> caseInsensitiveDataAttributes)
public void setDataAttributeCaseCanonicalizationFunctions(java.util.Map<CaseCanonicalizationMode,java.text.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 java.util.Map<CaseCanonicalizationMode,java.text.MessageFormat> getDataAttributeCaseCanonicalizationFunctions()
Copyright © 2005-2018. All Rights Reserved.