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

java.lang.Object
  extended by org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
      extended by org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
          extended by org.jasig.services.persondir.support.AbstractQueryPersonAttributeDao
              extended by org.jasig.services.persondir.support.jdbc.AbstractJdbcPersonAttributeDao
All Implemented Interfaces:
org.jasig.services.persondir.IPersonAttributeDao
Direct Known Subclasses:
MultiRowJdbcPersonAttributeDao, SingleRowJdbcPersonAttributeDao

public abstract class AbstractJdbcPersonAttributeDao
extends AbstractQueryPersonAttributeDao

Provides common logic for executing a JDBC based attribute query.

Version:
$Revision: 43106 $
Author:
Eric Dalquist

Field Summary
 
Fields inherited from class org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
logger
 
Constructor Summary
AbstractJdbcPersonAttributeDao(DataSource ds, String sql)
           
 
Method Summary
protected  String getSql()
           
protected  Map<String,List<Object>> getUserAttributesIfNeeded(Object[] args)
          Runs the sql specified in the constructor.
Calls parseAttributeMapFromResults(List) with the query results.
Returns results from parseAttributeMapFromResults(List) link.
protected abstract  Map<String,List<Object>> parseAttributeMapFromResults(List<Map<String,Object>> queryResults)
          Takes the List of Maps from the query and parses it into the attribute Map to be returned.
 
Methods inherited from class org.jasig.services.persondir.support.AbstractQueryPersonAttributeDao
getMultivaluedUserAttributes, getQueryArgumentArray, getQueryAttributes, getUserAttributesIfNeeded, setQueryAttributes
 
Methods inherited from class org.jasig.services.persondir.support.AbstractDefaultAttributePersonAttributeDao
getDefaultAttributeName, getMultivaluedUserAttributes, setDefaultAttributeName
 
Methods inherited from class org.jasig.services.persondir.support.AbstractFlatteningPersonAttributeDao
flattenResults, getUserAttributes, getUserAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jasig.services.persondir.IPersonAttributeDao
getPossibleUserAttributeNames
 

Constructor Detail

AbstractJdbcPersonAttributeDao

public AbstractJdbcPersonAttributeDao(DataSource ds,
                                      String sql)
Parameters:
ds - The DataSource to use for queries
sql - The SQL to execute
Method Detail

getSql

protected String getSql()
Returns:
the sql that is used for the query

parseAttributeMapFromResults

protected abstract Map<String,List<Object>> parseAttributeMapFromResults(List<Map<String,Object>> queryResults)
Takes the List of Maps from the query and parses it into the attribute Map to be returned.

Parameters:
queryResults - Results from the query.
Returns:
The results of the query, as specified by IPersonAttributeDao.getMultivaluedUserAttributes(Map)

getUserAttributesIfNeeded

protected final Map<String,List<Object>> getUserAttributesIfNeeded(Object[] args)
Runs the sql specified in the constructor.
Calls parseAttributeMapFromResults(List) with the query results.
Returns results from parseAttributeMapFromResults(List) link.

Overrides:
getUserAttributesIfNeeded in class AbstractQueryPersonAttributeDao
Parameters:
args - The arguments to execute the query with.
Returns:
The results of the query, as specified by IPersonAttributeDao.getUserAttributes(Map)


Copyright © 1998-2008 Java Architectures Special Interest Group. All Rights Reserved.