类 SqlQuery<T>

  • 类型参数:
    T - the result type
    所有已实现的接口:
    InitializingBean
    直接已知子类:
    GenericSqlQuery, MappingSqlQueryWithParameters, UpdatableSqlQuery

    public abstract class SqlQuery<T>
    extends SqlOperation
    Reusable operation object representing an SQL query.

    Subclasses must implement the newRowMapper(java.lang.Object[], java.util.Map<?, ?>) method to provide an object that can extract the results of iterating over the ResultSet created during the execution of the query.

    This class provides a number of public execute methods that are analogous to the different convenient JDO query execute methods. Subclasses can either rely on one of these inherited methods, or can add their own custom execution methods, with meaningful names and typed parameters (definitely a best practice). Each custom query method will invoke one of this class's untyped query methods.

    Like all RdbmsOperation classes that ship with the Spring Framework, SqlQuery instances are thread-safe after their initialization is complete. That is, after they are constructed and configured via their setter methods, they can be used safely from multiple threads.

    作者:
    Rod Johnson, Juergen Hoeller, Thomas Risberg
    另请参阅:
    SqlUpdate