public class BatchAction extends BaseSQLAction
Modifier and Type | Field and Description |
---|---|
protected RowDescriptor |
keyRowDescriptor |
protected BatchQuery |
query |
protected boolean |
runningAsBatch |
dataNode
Constructor and Description |
---|
BatchAction(BatchQuery query,
DataNode dataNode,
boolean runningAsBatch) |
Modifier and Type | Method and Description |
---|---|
protected BatchTranslator |
createTranslator() |
BatchQuery |
getQuery() |
protected boolean |
hasGeneratedKeys()
Returns whether BatchQuery generates any keys.
|
void |
performAction(Connection connection,
OperationObserver observer)
Executes a query using a strategy defined by the implementation.
|
protected PreparedStatement |
prepareStatement(Connection connection,
String queryStr,
DbAdapter adapter,
boolean generatedKeys) |
protected void |
processGeneratedKeys(Statement statement,
OperationObserver observer,
BatchQueryRow row)
Implements generated keys extraction supported in JDBC 3.0 specification.
|
protected void |
runAsBatch(Connection con,
BatchTranslator translator,
OperationObserver delegate) |
protected void |
runAsIndividualQueries(Connection connection,
BatchTranslator translator,
OperationObserver delegate,
boolean generatesKeys)
Executes batch as individual queries over the same prepared statement.
|
getInMemoryOffset, readResultSet
protected boolean runningAsBatch
protected BatchQuery query
protected RowDescriptor keyRowDescriptor
public BatchAction(BatchQuery query, DataNode dataNode, boolean runningAsBatch)
public BatchQuery getQuery()
public void performAction(Connection connection, OperationObserver observer) throws SQLException, Exception
SQLAction
SQLException
Exception
protected BatchTranslator createTranslator() throws CayenneException
CayenneException
protected void runAsBatch(Connection con, BatchTranslator translator, OperationObserver delegate) throws SQLException, Exception
SQLException
Exception
protected void runAsIndividualQueries(Connection connection, BatchTranslator translator, OperationObserver delegate, boolean generatesKeys) throws SQLException, Exception
SQLException
Exception
protected PreparedStatement prepareStatement(Connection connection, String queryStr, DbAdapter adapter, boolean generatedKeys) throws SQLException
SQLException
protected boolean hasGeneratedKeys()
protected void processGeneratedKeys(Statement statement, OperationObserver observer, BatchQueryRow row) throws SQLException, CayenneException
SQLException
CayenneException
Copyright © 2001–2023 Apache Cayenne. All rights reserved.