Save This Page
Home » spring-framework-2.5.4 » org.springframework » jdbc » object » [javadoc | source]
org.springframework.jdbc.object
abstract public class: MappingSqlQuery [javadoc | source]
java.lang.Object
   org.springframework.jdbc.object.RdbmsOperation
      org.springframework.jdbc.object.SqlOperation
         org.springframework.jdbc.object.SqlQuery
            org.springframework.jdbc.object.MappingSqlQueryWithParameters
               org.springframework.jdbc.object.MappingSqlQuery

All Implemented Interfaces:
    InitializingBean

Direct Known Subclasses:
    SqlFunction

Reusable query in which concrete subclasses must implement the abstract mapRow(ResultSet, int) method to convert each row of the JDBC ResultSet into an object.

Simplifies MappingSqlQueryWithParameters API by dropping parameters and context. Most subclasses won't care about parameters. If you don't use contextual information, subclass this instead of MappingSqlQueryWithParameters.

Fields inherited from org.springframework.jdbc.object.RdbmsOperation:
logger
Constructor:
 public MappingSqlQuery() 
 public MappingSqlQuery(DataSource ds,
    String sql) 
    Convenient constructor with DataSource and SQL string.
    Parameters:
    ds - DataSource to use to obtain connections
    sql - SQL to run
Method from org.springframework.jdbc.object.MappingSqlQuery Summary:
mapRow,   mapRow
Methods from org.springframework.jdbc.object.MappingSqlQueryWithParameters:
mapRow,   newRowMapper
Methods from org.springframework.jdbc.object.SqlQuery:
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,   newRowMapper,   setRowsExpected
Methods from org.springframework.jdbc.object.SqlOperation:
compileInternal,   getParsedSql,   newPreparedStatementCreator,   newPreparedStatementCreator,   newPreparedStatementSetter,   onCompileInternal
Methods from org.springframework.jdbc.object.RdbmsOperation:
afterPropertiesSet,   allowsUnusedParameters,   checkCompiled,   compile,   compileInternal,   declareParameter,   getDeclaredParameters,   getGeneratedKeysColumnNames,   getJdbcTemplate,   getResultSetType,   getSql,   isCompiled,   isReturnGeneratedKeys,   isUpdatableResults,   setDataSource,   setFetchSize,   setGeneratedKeysColumnNames,   setJdbcTemplate,   setMaxRows,   setParameters,   setQueryTimeout,   setResultSetType,   setReturnGeneratedKeys,   setSql,   setTypes,   setUpdatableResults,   supportsLobParameters,   validateNamedParameters,   validateParameters
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.jdbc.object.MappingSqlQuery Detail:
 abstract protected Object mapRow(ResultSet rs,
    int rowNum) throws SQLException
    Subclasses must implement this method to convert each row of the ResultSet into an object of the result type.

    Subclasses of this class, as opposed to direct subclasses of MappingSqlQueryWithParameters, don't need to concern themselves with the parameters to the execute method of the query object.

 protected final Object mapRow(ResultSet rs,
    int rowNum,
    Object[] parameters,
    Map context) throws SQLException 
    This method is implemented to invoke the simpler mapRow template method, ignoring parameters.