|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CallHandler<T>
Processes the results of an SQL stored procedure call and returns an object of type T
that describes the results.
Attention: It is recommended that CallHandlerWithParameters<CAL>
be used instead of CallHandler<T>
.
The default pureQuery behavior for annotated and inline methods executing SQL stored procedure calls is to return all of the query results and OUT and INOUT parameters in an instance of StoredProcedureResult
. Additionally, the default behavior is to update Map
s and pureQuery beans that were passed to the annotated or inline method to represent OUT and INOUT parameters. For an example, see Data.call(String, Object...)
. When some other behavior is wanted, an implementation of CallHandlerWithParameters<CAL>
or CallHandler<T>
can be specified.
CallHandlerWithParameters<CAL>
or CallHandler<T>
can be specified by using either the method Data.call(String, CallHandlerWithParameters, Object...)
or the method Data.call(String, CallHandler, Object...)
.CallHandler<T>
cannot be specified. Instead, CallHandlerWithParameters<CAL>
should be used.Specifying a CallHandler<T>
implementation causes its handleCall(CallableStatement)
method to be used to process the results of the SQL stored procedure call and to create an object of type T
that describes the results. The created object is returned from the associated annotated or inline method. The handleCall
method can perform other actions as well.
The object of type T
that is returned by CallHandler<T>
can contain as much information about the results of the stored procedure call as is wanted. The following examples show possible types for T
:
T
can be null
.T
can resemble StoredProcedureResult
and contain information such as the returned query results and the SQL stored procedure OUT and INOUT parameters.T
can be a completely different type of object.Attention: pureQuery calls cstmt.execute()
before calling handleCall(CallableStatement cstmt)
, so cstmt.execute()
must not be called in handleCall (CallableStatement cstmt)
.
Handler.callHandlerWithParameters()
, Data.call(String, CallHandler, Object...)
, StoredProcedureResult
, CallHandlerWithParameters
Modifier and Type | Method and Description |
---|---|
T |
handleCall(CallableStatement cstmt) Processes the results of an SQL stored procedure call and returns an object of type T that describes the results. |
T handleCall(CallableStatement cstmt) throws SQLException
T
that describes the results.
Attention: pureQuery calls cstmt.execute()
before calling handleCall(CallableStatement cstmt)
, so cstmt.execute()
must not be called in handleCall (CallableStatement cstmt)
.
cstmt
- a CallableStatement
that represents an SQL stored procedure. When this method is called by pureQuery, cstmt
has already been executed.T
that describes the results of the SQL stored procedure callSQLException
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |