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, readResultSetprotected 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
SQLActionSQLExceptionExceptionprotected BatchTranslator createTranslator() throws CayenneException
CayenneExceptionprotected void runAsBatch(Connection con, BatchTranslator translator, OperationObserver delegate) throws SQLException, Exception
SQLExceptionExceptionprotected void runAsIndividualQueries(Connection connection, BatchTranslator translator, OperationObserver delegate, boolean generatesKeys) throws SQLException, Exception
SQLExceptionExceptionprotected PreparedStatement prepareStatement(Connection connection, String queryStr, DbAdapter adapter, boolean generatedKeys) throws SQLException
SQLExceptionprotected boolean hasGeneratedKeys()
protected void processGeneratedKeys(Statement statement, OperationObserver observer, BatchQueryRow row) throws SQLException, CayenneException
SQLExceptionCayenneExceptionCopyright © 2001–2023 Apache Cayenne. All rights reserved.