com.interface21.jdbc.object
Class ReflectionExtractionSqlQuery
java.lang.Object
|
+--com.interface21.jdbc.object.RdbmsOperation
|
+--com.interface21.jdbc.object.SqlOperation
|
+--com.interface21.jdbc.object.SqlQuery
|
+--com.interface21.jdbc.object.ReflectionExtractionSqlQuery
- All Implemented Interfaces:
- InitializingBean
- public abstract class ReflectionExtractionSqlQuery
- extends SqlQuery
Reusable threadsafe query in which reflection is used to
extract each result row.
Each object must be of the same type.
NOTE : THIS CLASS IS A DEMONSTRATION ONLY OF THIS APPROACH.
IT IS NOT FULLY IMPLEMENTED, DOCUMENTED OR TESTED.
| Methods inherited from class com.interface21.jdbc.object.SqlQuery |
execute, execute, execute, execute, execute, findObject, findObject, findObject, findObject, getRowsExpected, newResultReader, setRowsExpected |
| Methods inherited from class com.interface21.jdbc.object.RdbmsOperation |
afterPropertiesSet, compile, declareParameter, getDataSource, getDeclaredParameters, getSql, isCompiled, setDataSource, setSql, setTypes, validateParameters |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectionExtractionSqlQuery
protected ReflectionExtractionSqlQuery()
- Only subclasses can use this: they must
remember to set the result class later
getResultClass
public java.lang.Class getResultClass()
setResultClassname
public void setResultClassname(java.lang.String classname)
throws InvalidDataAccessApiUsageException
setResultClass
protected void setResultClass(java.lang.Class resultClass)
onCompileInternal
protected void onCompileInternal()
throws InvalidDataAccessApiUsageException
- Description copied from class:
SqlQuery
- Subclasses can override this method to implement custom behavior on
compilation. This implementation does nothing.
- Overrides:
onCompileInternal in class SqlQuery
newResultReader
protected ResultReader newResultReader(int rowsExpected)
- Use reflection to extract an object from each row of the result.
Rod Johnson and Spring contributors 2001-2003.