ProcedureCall (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.query, class: ProcedureCall

# Class ProcedureCall<T>

java.lang.Object
org.apache.cayenne.query.IndirectQuery
org.apache.cayenne.query.ProcedureCall<T>

All Implemented Interfaces:
  `Serializable, Query`

public class ProcedureCall<T> extends IndirectQuery
Fluent API for calling stored procedures.

Since:
  4.0
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected CapsStrategy`
  `capsStrategy`
  `protected Boolean`
  `fetchingDataRows`
  `protected Integer`
  `fetchLimit`
  `protected Integer`
  `fetchOffset`
  `protected Map<String,Object>`
  `params`
  `protected String`
  `procedureName`
  `protected Class<T>`
  `resultClass`
  `protected ColumnDescriptor[]`
  `resultDescriptor`

  ### Fields inherited from class IndirectQuery

  `dataMap, lastResolver, name, replacementQuery`
  Modifier and Type
  Field
  Description
  `protected DataMap`
  `dataMap`
  `protected EntityResolver`
  `lastResolver`
  `protected String`
  `name`
  `protected Query`
  `replacementQuery`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ProcedureCall(String procedureName)`
  `ProcedureCall(String procedureName, Class<T> resultClass)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int[]`
  `batchUpdate(ObjectContext context)`
  `ProcedureResult<T>`
  `call(ObjectContext context)`
  `ProcedureCall<T>`
  `capsStrategy(CapsStrategy capsStrategy)`
  `protected Query`
  `createReplacementQuery(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.
  `ProcedureCall<T>`
  `limit(int fetchLimit)`
  `ProcedureCall<T>`
  `offset(int fetchOffset)`
  `ProcedureCall<T>`
  `param(String name, Object value)`
  `ProcedureCall<T>`
  `params(Map<String,?> parameters)`
  `static ProcedureCall`
  `query(String procedure)`
  Creates procedure call using name of stored procedure defined in the mapping file.
  `static <T> ProcedureCall<T>`
  `query(String procedure, Class<T> resultClass)`
  Creates procedure call using name of stored procedure defined in the mapping file and specifies data type of the objects it should return.
  `ProcedureCall<T>`
  `resultDescriptor(ColumnDescriptor[] resultDescriptor)`
  `List<T>`
  `select(ObjectContext context)`
  `int`
  `update(ObjectContext context)`

  ### Methods inherited from class IndirectQuery

  `createSQLAction, getMetaData, getReplacementQuery, route`
  Modifier and Type
  Method
  Description
  `SQLAction`
  `createSQLAction(SQLActionVisitor visitor)`
  Throws an exception as indirect query should not be executed directly.
  `QueryMetadata`
  `getMetaData(EntityResolver resolver)`
  Returns the metadata obtained from the replacement query.
  `protected Query`
  `getReplacementQuery(EntityResolver resolver)`
  Returns a replacement query, creating it on demand and caching it for reuse.
  `void`
  `route(QueryRouter router, EntityResolver resolver, Query substitutedQuery)`
  Delegates routing to a replacement query.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### procedureName

    protected String procedureName

  - ### resultClass

    protected Class<T> resultClass

  - ### params

    protected Map<String,Object> params

  - ### fetchLimit

    protected Integer fetchLimit

  - ### fetchOffset

    protected Integer fetchOffset

  - ### capsStrategy

    protected CapsStrategy capsStrategy

  - ### fetchingDataRows

    protected Boolean fetchingDataRows

  - ### resultDescriptor

    protected ColumnDescriptor[] resultDescriptor

- ## Constructor Details

  - ### ProcedureCall

    public ProcedureCall(String procedureName)

  - ### ProcedureCall

    public ProcedureCall(String procedureName, Class<T> resultClass)

- ## Method Details

  - ### query

    public static ProcedureCall query(String procedure)
    Creates procedure call using name of stored procedure defined in the mapping file.

  - ### dataRowQuery

    public static ProcedureCall<DataRow> dataRowQuery(String procedure)
    Creates procedure call returning data rows using name of stored procedure defined in the mapping file.

  - ### query

    public static <T> ProcedureCall<T> query(String procedure, Class<T> resultClass)
    Creates procedure call using name of stored procedure defined in the mapping file and specifies data type of the objects it should return.

  - ### params

    public ProcedureCall<T> params(Map<String,?> parameters)

  - ### param

    public ProcedureCall<T> param(String name, Object value)

  - ### limit

    public ProcedureCall<T> limit(int fetchLimit)

  - ### offset

    public ProcedureCall<T> offset(int fetchOffset)

  - ### capsStrategy

    public ProcedureCall<T> capsStrategy(CapsStrategy capsStrategy)

  - ### resultDescriptor

    public ProcedureCall<T> resultDescriptor(ColumnDescriptor[] resultDescriptor)

  - ### call

    public ProcedureResult<T> call(ObjectContext context)

  - ### select

    public List<T> select(ObjectContext context)

  - ### batchUpdate

    public int[] batchUpdate(ObjectContext context)

  - ### update

    public int update(ObjectContext context)

  - ### createReplacementQuery

    protected Query createReplacementQuery(EntityResolver resolver)
    Description copied from class: `IndirectQuery`
    Creates a substitute query. An implementor is free to provide an arbitrary replacement query.
    Specified by:
      `createReplacementQuery` in class `IndirectQuery`