org.apache.cayenne.access.translator.procedure

## Class ProcedureTranslator

- java.lang.Object
- - org.apache.cayenne.access.translator.procedure.ProcedureTranslator

- Direct Known Subclasses:
    HSQLDBProcedureTranslator

      public class ProcedureTranslator
      extends Object

  Stored procedure query translator.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DbAdapter` | `adapter`
    `protected List<ProcedureParameter>` | `callParams`
    `protected Connection` | `connection`
    `protected EntityResolver` | `entityResolver`
    `protected JdbcEventLogger` | `logger`
    `protected ProcedureQuery` | `query`
    `protected List<Object>` | `values`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProcedureTranslator()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `createSqlString()` Creates an SQL String for the stored procedure call.
    `PreparedStatement` | `createStatement()` Creates and binds a PreparedStatement to execute query SQL via JDBC.
    `JdbcEventLogger` | `getJdbcEventLogger()`
    `Procedure` | `getProcedure()`
    `ProcedureQuery` | `getProcedureQuery()`
    `protected void` | `initStatement(CallableStatement stmt)` Set IN and OUT parameters.
    `protected void` | `initValues()`
    `void` | `setAdapter(DbAdapter adapter)`
    `void` | `setConnection(Connection connection)`
    `void` | `setEntityResolver(EntityResolver entityResolver)`
    `protected void` | `setInParam(CallableStatement stmt, ProcedureParameter param, Object val, int pos)` Sets a single IN parameter of the CallableStatement.
    `void` | `setJdbcEventLogger(JdbcEventLogger logger)`
    `protected void` | `setOutParam(CallableStatement stmt, ProcedureParameter param, int pos)` Sets a single OUT parameter of the CallableStatement.
    `void` | `setQuery(ProcedureQuery query)`

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

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

- - ### Field Detail

    - #### query

          protected ProcedureQuery query

    - #### connection

          protected Connection connection

    - #### adapter

          protected DbAdapter adapter

    - #### entityResolver

          protected EntityResolver entityResolver

    - #### callParams

          protected List<ProcedureParameter> callParams

    - #### values

          protected List<Object> values

    - #### logger

          protected JdbcEventLogger logger

  - ### Constructor Detail

    - #### ProcedureTranslator

          public ProcedureTranslator()

  - ### Method Detail

    - #### setQuery

          public void setQuery(ProcedureQuery query)

    - #### setConnection

          public void setConnection(Connection connection)

    - #### setAdapter

          public void setAdapter(DbAdapter adapter)

    - #### setJdbcEventLogger

          public void setJdbcEventLogger(JdbcEventLogger logger)

      Since:
        3.1

    - #### getJdbcEventLogger

          public JdbcEventLogger getJdbcEventLogger()

      Since:
        3.1

    - #### setEntityResolver

          public void setEntityResolver(EntityResolver entityResolver)

      Since:
        1.2

    - #### createSqlString

          protected String createSqlString()

      Creates an SQL String for the stored procedure call.

    - #### createStatement

          public PreparedStatement createStatement()
                                            throws Exception

      Creates and binds a PreparedStatement to execute query SQL via JDBC.
      Throws:
        `Exception`

    - #### getProcedure

          public Procedure getProcedure()

    - #### getProcedureQuery

          public ProcedureQuery getProcedureQuery()

    - #### initStatement

          protected void initStatement(CallableStatement stmt)
                                throws Exception

      Set IN and OUT parameters.
      Throws:
        `Exception`

    - #### initValues

          protected void initValues()

    - #### setInParam

          protected void setInParam(CallableStatement stmt,
                                    ProcedureParameter param,
                                    Object val,
                                    int pos)
                             throws Exception

      Sets a single IN parameter of the CallableStatement.
      Throws:
        `Exception`

    - #### setOutParam

          protected void setOutParam(CallableStatement stmt,
                                     ProcedureParameter param,
                                     int pos)
                              throws Exception

      Sets a single OUT parameter of the CallableStatement.
      Throws:
        `Exception`

Copyright © 2001–2021 Apache Cayenne. All rights reserved.