Package 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:
- PostgresBatchAction,- SQLServerBatchAction
- Since:
- 1.2
- 
Field SummaryFieldsFields inherited from class org.apache.cayenne.access.jdbc.BaseSQLActiondataNode
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanprotected BatchTranslatorgetQuery()protected booleanReturns whether BatchQuery generates any keys.voidperformAction(Connection connection, OperationObserver observer) Executes a query using a strategy defined by the implementation.protected PreparedStatementprepareStatement(Connection connection, String queryStr, DbAdapter adapter, boolean generatedKeys) protected voidprocessGeneratedKeys(Statement statement, OperationObserver observer, List<BatchQueryRow> rows) protected voidprocessGeneratedKeys(Statement statement, OperationObserver observer, BatchQueryRow row) Implements generated keys extraction supported in JDBC 3.0 specification.protected voidrunAsBatch(Connection con, BatchTranslator translator, OperationObserver delegate, boolean generatesKeys) protected voidrunAsIndividualQueries(Connection connection, BatchTranslator translator, OperationObserver delegate, boolean generatesKeys) Executes batch as individual queries over the same prepared statement.protected booleansupportsGeneratedKeys(boolean isBatch) Methods inherited from class org.apache.cayenne.access.jdbc.BaseSQLActiongetInMemoryOffset, readResultSet
- 
Field Details- 
runningAsBatchprotected boolean runningAsBatch
- 
query
- 
keyRowDescriptor
 
- 
- 
Constructor Details- 
BatchAction- Since:
- 4.0
 
 
- 
- 
Method Details- 
getQuery- Returns:
- Query which originated this action
 
- 
performActionDescription copied from interface:SQLActionExecutes a query using a strategy defined by the implementation.- Throws:
- Exception
 
- 
canRunAsBatchprotected boolean canRunAsBatch()
- 
createTranslator
- 
runAsBatchprotected void runAsBatch(Connection con, BatchTranslator translator, OperationObserver delegate, boolean generatesKeys) throws Exception - Throws:
- Exception
 
- 
runAsIndividualQueriesprotected void runAsIndividualQueries(Connection connection, BatchTranslator translator, OperationObserver delegate, boolean generatesKeys) throws SQLException, Exception Executes batch as individual queries over the same prepared statement.- Throws:
- SQLException
- Exception
 
- 
prepareStatementprotected PreparedStatement prepareStatement(Connection connection, String queryStr, DbAdapter adapter, boolean generatedKeys) throws SQLException - Throws:
- SQLException
 
- 
supportsGeneratedKeysprotected boolean supportsGeneratedKeys(boolean isBatch) 
- 
hasGeneratedKeysprotected boolean hasGeneratedKeys()Returns whether BatchQuery generates any keys.
- 
processGeneratedKeysprotected void processGeneratedKeys(Statement statement, OperationObserver observer, BatchQueryRow row) throws SQLException Implements generated keys extraction supported in JDBC 3.0 specification.- Throws:
- SQLException
- Since:
- 4.0
 
- 
processGeneratedKeysprotected void processGeneratedKeys(Statement statement, OperationObserver observer, List<BatchQueryRow> rows) throws SQLException - Throws:
- SQLException
- Since:
- 4.2
 
 
-