org.jasig.portal.services.persondir.support
Class JdbcPersonAttributeDaoImpl.PersonAttributeMappingQuery

java.lang.Object
  extended by org.springframework.jdbc.object.RdbmsOperation
      extended by org.springframework.jdbc.object.SqlOperation
          extended by org.springframework.jdbc.object.SqlQuery
              extended by org.springframework.jdbc.object.MappingSqlQueryWithParameters
                  extended by org.springframework.jdbc.object.MappingSqlQuery
                      extended by org.jasig.portal.services.persondir.support.JdbcPersonAttributeDaoImpl.PersonAttributeMappingQuery
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
Enclosing class:
JdbcPersonAttributeDaoImpl

private class JdbcPersonAttributeDaoImpl.PersonAttributeMappingQuery
extends org.springframework.jdbc.object.MappingSqlQuery

An object which will execute a SQL query with the expectation of yielding a ResultSet with zero or one rows, which it maps to null or to a Map from uPortal attribute names to values.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.jdbc.object.MappingSqlQueryWithParameters
org.springframework.jdbc.object.MappingSqlQueryWithParameters.ResultReaderImpl
 
Field Summary
 
Fields inherited from class org.springframework.jdbc.object.RdbmsOperation
logger
 
Constructor Summary
JdbcPersonAttributeDaoImpl.PersonAttributeMappingQuery(javax.sql.DataSource ds, java.lang.String sql)
          Instantiate the query, providing a DataSource against which the query will run and the SQL representing the query, which should take exactly one parameter: the unique ID of the user.
 
Method Summary
private  void addMappedAttributes(java.sql.ResultSet rs, java.lang.String columnName, java.util.Map rowResults)
          Tries to get the attributes specified for the column, determin the mapping for the column and add it to the rowResults Map.
protected  java.lang.Object mapRow(java.sql.ResultSet rs, int rowNum)
          How attribute name mapping works: If the column is mapped use the mapped name(s)
If the column is listed and not mapped use the column name
 java.lang.String toString()
           
 
Methods inherited from class org.springframework.jdbc.object.MappingSqlQuery
mapRow
 
Methods inherited from class org.springframework.jdbc.object.MappingSqlQueryWithParameters
newResultReader
 
Methods inherited from class org.springframework.jdbc.object.SqlQuery
execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, getRowsExpected, setRowsExpected
 
Methods inherited from class org.springframework.jdbc.object.SqlOperation
compileInternal, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
 
Methods inherited from class org.springframework.jdbc.object.RdbmsOperation
afterPropertiesSet, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JdbcPersonAttributeDaoImpl.PersonAttributeMappingQuery

public JdbcPersonAttributeDaoImpl.PersonAttributeMappingQuery(javax.sql.DataSource ds,
                                                              java.lang.String sql)
Instantiate the query, providing a DataSource against which the query will run and the SQL representing the query, which should take exactly one parameter: the unique ID of the user.

Parameters:
ds - The data source to use for running the query against.
sql - The SQL to run against the data source.
Method Detail

mapRow

protected java.lang.Object mapRow(java.sql.ResultSet rs,
                                  int rowNum)
                           throws java.sql.SQLException
How attribute name mapping works: If the column is mapped use the mapped name(s)
If the column is listed and not mapped use the column name

Specified by:
mapRow in class org.springframework.jdbc.object.MappingSqlQuery
Throws:
java.sql.SQLException
See Also:
MappingSqlQuery.mapRow(java.sql.ResultSet, int)

addMappedAttributes

private void addMappedAttributes(java.sql.ResultSet rs,
                                 java.lang.String columnName,
                                 java.util.Map rowResults)
                          throws java.sql.SQLException
Tries to get the attributes specified for the column, determin the mapping for the column and add it to the rowResults Map.

Parameters:
rs - The ResultSet to get the attribute value from.
columnName - The name of the column to get the attribute value from.
rowResults - The Map to add the mapped attribute to.
Throws:
java.sql.SQLException - If there is a problem retrieving the value from the ResultSet.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object