Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.access.jdbc
Class BatchAction

    java.lang.Object
      org.apache.cayenne.access.jdbc.BaseSQLAction
          org.apache.cayenne.access.jdbc.BatchAction

All Implemented Interfaces:
  SQLAction

Direct Known Subclasses:
  SQLServerBatchAction

    public class BatchAction

extends BaseSQLAction

Since:
  1.2
Author:
  Andrei Adamchik

Field Summary
`protected boolean` | `batch`
`protected BatchQuery` | `query`

Fields inherited from class org.apache.cayenne.access.jdbc.BaseSQLAction
`adapter, entityResolver`

Constructor Summary
`BatchAction(BatchQuery batchQuery, DbAdapter adapter, EntityResolver entityResolver)`

Method Summary
`protected BatchQueryBuilder` | `createBuilder()`
`protected boolean` | `hasGeneratedKeys()` Returns whether BatchQuery generates any keys.
`boolean` | `isBatch()`
`void` | `performAction(java.sql.Connection connection, OperationObserver observer)` Executes a query using a strategy defined by the implementation.
`protected void` | `processGeneratedKeys(java.sql.Statement statement, OperationObserver observer)` Implements generated keys extraction supported in JDBC 3.0 specification.
`protected void` | `runAsBatch(java.sql.Connection con, BatchQueryBuilder queryBuilder, OperationObserver delegate)`
`protected void` | `runAsIndividualQueries(java.sql.Connection connection, BatchQueryBuilder queryBuilder, OperationObserver delegate, boolean generatesKeys)` Executes batch as individual queries over the same prepared statement.
`void` | `setBatch(boolean runningAsBatch)`

Methods inherited from class org.apache.cayenne.access.jdbc.BaseSQLAction
`getAdapter, getEntityResolver, readResultSet`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### batch

    protected boolean batch

### query

    protected BatchQuery query

Constructor Detail

### BatchAction

    public BatchAction(BatchQuery batchQuery,
                       DbAdapter adapter,
                       EntityResolver entityResolver)

Method Detail

### isBatch

    public boolean isBatch()

### setBatch

    public void setBatch(boolean runningAsBatch)

### performAction

    public void performAction(java.sql.Connection connection,
                              OperationObserver observer)
                       throws java.sql.SQLException,
                              java.lang.Exception

  Description copied from interface: `SQLAction`
  Executes a query using a strategy defined by the implementation.

  Throws:
    `java.sql.SQLException`
    `java.lang.Exception`

### createBuilder

    protected BatchQueryBuilder createBuilder()
                                       throws CayenneException

  Throws:
    `CayenneException`

### runAsBatch

    protected void runAsBatch(java.sql.Connection con,
                              BatchQueryBuilder queryBuilder,
                              OperationObserver delegate)
                       throws java.sql.SQLException,
                              java.lang.Exception

  Throws:
    `java.sql.SQLException`
    `java.lang.Exception`

### runAsIndividualQueries

    protected void runAsIndividualQueries(java.sql.Connection connection,
                                          BatchQueryBuilder queryBuilder,
                                          OperationObserver delegate,
                                          boolean generatesKeys)
                                   throws java.sql.SQLException,
                                          java.lang.Exception

  Executes batch as individual queries over the same prepared statement.

  Throws:
    `java.sql.SQLException`
    `java.lang.Exception`

### hasGeneratedKeys

    protected boolean hasGeneratedKeys()

  Returns whether BatchQuery generates any keys.

### processGeneratedKeys

    protected void processGeneratedKeys(java.sql.Statement statement,
                                        OperationObserver observer)
                                 throws java.sql.SQLException,
                                        CayenneException

  Implements generated keys extraction supported in JDBC 3.0 specification.

  Throws:
    `java.sql.SQLException`
    `CayenneException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2006 Apache.org All Rights Reserved.