类 SqlFunction<T>

  • 类型参数:
    T - the result type
    所有已实现的接口:
    InitializingBean

    public class SqlFunction<T>
    extends MappingSqlQuery<T>
    SQL "function" wrapper for a query that returns a single row of results. The default behavior is to return an int, but that can be overridden by using the constructor with an extra return type parameter.

    Intended to use to call SQL functions that return a single result using a query like "select user()" or "select sysdate from dual". It is not intended for calling more complex stored functions or for using a CallableStatement to invoke a stored procedure or stored function. Use StoredProcedure or SqlCall for this type of processing.

    This is a concrete class, which there is often no need to subclass. Code using this package can create an object of this type, declaring SQL and parameters, and then invoke the appropriate run method repeatedly to execute the function. Subclasses are only supposed to add specialized run methods for specific parameter and return types.

    Like all RdbmsOperation objects, SqlFunction objects are thread-safe.

    作者:
    Rod Johnson, Juergen Hoeller, Jean-Pierre Pawlak
    另请参阅:
    StoredProcedure