Package org.apache.cayenne.query

## 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 org.apache.cayenne.query.IndirectQuery

      `dataMap, lastResolver, name, replacementQuery`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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 org.apache.cayenne.query.IndirectQuery

      `createSQLAction, getMetaData, getReplacementQuery, route`

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### 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 Detail

    - #### ProcedureCall

          public ProcedureCall​(String procedureName)

    - #### ProcedureCall

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

  - ### Method Detail

    - #### 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`