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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
batch
protected boolean batch
query
protected BatchQuery query
keyRowDescriptor
protected RowDescriptor keyRowDescriptor
queryBuilderFactory
protected BatchQueryBuilderFactory queryBuilderFactory
- Custom BatchQueryBuilderFactory. Can be null, then default will be used.
BatchAction
public BatchAction(BatchQuery batchQuery,
DbAdapter adapter,
EntityResolver entityResolver)
getQuery
public BatchQuery getQuery()
- Returns:
- Query which originated this action
isBatch
public boolean isBatch()
setBatch
public void setBatch(boolean runningAsBatch)
performAction
public void performAction(Connection connection,
OperationObserver observer)
throws SQLException,
Exception
- Description copied from interface:
SQLAction
- Executes a query using a strategy defined by the implementation.
- Throws:
SQLException
Exception
getQueryBuilderFactory
public BatchQueryBuilderFactory getQueryBuilderFactory()
- Returns:
- factory that creates BatchQueryBuilders
setQueryBuilderFactory
public void setQueryBuilderFactory(BatchQueryBuilderFactory queryBuilderFactory)
createBuilder
protected BatchQueryBuilder createBuilder()
throws CayenneException
- Throws:
CayenneException
runAsBatch
protected void runAsBatch(Connection con,
BatchQueryBuilder queryBuilder,
OperationObserver delegate)
throws SQLException,
Exception
- Throws:
SQLException
Exception
runAsIndividualQueries
protected void runAsIndividualQueries(Connection connection,
BatchQueryBuilder queryBuilder,
OperationObserver delegate,
boolean generatesKeys)
throws SQLException,
Exception
- Executes batch as individual queries over the same prepared statement.
- Throws:
SQLException
Exception
hasGeneratedKeys
protected boolean hasGeneratedKeys()
- Returns whether BatchQuery generates any keys.
processGeneratedKeys
protected void processGeneratedKeys(Statement statement,
OperationObserver observer)
throws SQLException,
CayenneException
- Implements generated keys extraction supported in JDBC 3.0 specification.
- Throws:
SQLException
CayenneException
Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.