T
- the result typepublic class GenericSqlQuery<T> extends SqlQuery<T>
setRowMapper(org.springframework.jdbc.core.RowMapper<T>)
,
setRowMapperClass(java.lang.Class<? extends org.springframework.jdbc.core.RowMapper>)
logger
Constructor and Description |
---|
GenericSqlQuery() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Ensures compilation if used in a bean factory.
|
protected RowMapper<T> |
newRowMapper(Object[] parameters,
Map<?,?> context)
Subclasses must implement this method to extract an object per row, to be
returned by the
execute method as an aggregated List . |
void |
setRowMapper(RowMapper<T> rowMapper)
Set a specific
RowMapper instance to use for this query. |
void |
setRowMapperClass(Class<? extends RowMapper> rowMapperClass)
|
execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeByNamedParam, executeByNamedParam, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObject, findObjectByNamedParam, findObjectByNamedParam, getRowsExpected, setRowsExpected
compileInternal, getParsedSql, newPreparedStatementCreator, newPreparedStatementCreator, newPreparedStatementSetter, onCompileInternal
allowsUnusedParameters, checkCompiled, compile, declareParameter, getDeclaredParameters, getGeneratedKeysColumnNames, getJdbcTemplate, getResultSetType, getSql, isCompiled, isReturnGeneratedKeys, isUpdatableResults, resolveSql, setDataSource, setFetchSize, setGeneratedKeysColumnNames, setJdbcTemplate, setMaxRows, setParameters, setQueryTimeout, setResultSetType, setReturnGeneratedKeys, setSql, setTypes, setUpdatableResults, supportsLobParameters, validateNamedParameters, validateParameters
public void setRowMapper(RowMapper<T> rowMapper)
RowMapper
instance to use for this query.public void afterPropertiesSet()
RdbmsOperation
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class RdbmsOperation
protected RowMapper<T> newRowMapper(@Nullable Object[] parameters, @Nullable Map<?,?> context)
SqlQuery
execute
method as an aggregated List
.newRowMapper
in class SqlQuery<T>
parameters
- the parameters to the execute()
method,
in case subclass is interested; may be null
if there
were no parameters.context
- the contextual information passed to the mapRow
callback method. The JDBC operation itself doesn't rely on this parameter,
but it can be useful for creating the objects of the result list.SqlQuery.execute(java.lang.Object[], java.util.Map<?, ?>)