Class ProcedureCall<T>
java.lang.Object
org.apache.cayenne.query.IndirectQuery
org.apache.cayenne.query.ProcedureCall<T>
- All Implemented Interfaces:
Query
Fluent API for calling stored procedures.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CapsStrategyprotected Booleanprotected Integerprotected Integerprotected Stringprotected ProcedureColumn[]Fields inherited from class IndirectQuery
dataMap, lastResolver, name, replacementQuery -
Constructor Summary
ConstructorsConstructorDescriptionProcedureCall(String procedureName) ProcedureCall(String procedureName, Class<T> resultClass) -
Method Summary
Modifier and TypeMethodDescriptionint[]batchUpdate(ObjectContext context) Executes the procedure, returning the counts of its first update.call(ObjectContext context) Executes the procedure, returning all of its result sets, update counts and OUT parameters in the order they were produced.capsStrategy(CapsStrategy capsStrategy) protected QuerycreateReplacementQuery(EntityResolver resolver) Creates a substitute query.static ProcedureCall<DataRow> dataRowQuery(String procedure) Creates procedure call returning data rows using name of stored procedure defined in the mapping file.limit(int fetchLimit) offset(int fetchOffset) static ProcedureCall<DataRow> Creates procedure call using name of stored procedure defined in the mapping file.static <T> ProcedureCall<T> Creates procedure call using name of stored procedure defined in the mapping file and specifies data type of the objects it should return.resultDescriptor(ProcedureColumn[] resultDescriptor) select(ObjectContext context) Executes the procedure, returning its first result set.intupdate(ObjectContext context) Executes the procedure, returning the count of its first update.Methods inherited from class IndirectQuery
createSQLAction, getMetaData, getReplacementQuery, route
-
Field Details
-
procedureName
-
resultClass
-
params
-
fetchLimit
-
fetchOffset
-
capsStrategy
-
fetchingDataRows
-
resultDescriptor
-
-
Constructor Details
-
ProcedureCall
-
ProcedureCall
-
-
Method Details
-
query
Creates procedure call using name of stored procedure defined in the mapping file. With no result class specified, the result sets are returned as data rows. -
dataRowQuery
Creates procedure call returning data rows using name of stored procedure defined in the mapping file. -
query
Creates procedure call using name of stored procedure defined in the mapping file and specifies data type of the objects it should return. -
params
-
param
-
limit
-
offset
-
capsStrategy
-
resultDescriptor
-
call
Executes the procedure, returning all of its result sets, update counts and OUT parameters in the order they were produced. -
select
Executes the procedure, returning its first result set.- Throws:
CayenneRuntimeException- if the procedure produced no result sets.
-
batchUpdate
Executes the procedure, returning the counts of its first update.- Throws:
CayenneRuntimeException- if the procedure produced no updates.
-
update
Executes the procedure, returning the count of its first update.- Throws:
CayenneRuntimeException- if the procedure produced no updates, or the first one is a batch update.
-
createReplacementQuery
Description copied from class:IndirectQueryCreates a substitute query. An implementor is free to provide an arbitrary replacement query.- Specified by:
createReplacementQueryin classIndirectQuery
-