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 |
processGeneratedKeys(Statement statement,
OperationObserver observer,
List<BatchQueryRow> rows) |
protected void |
runAsBatch(Connection con,
BatchTranslator translator,
OperationObserver delegate,
boolean generatesKeys) |
protected void |
runAsIndividualQueries(Connection connection,
BatchTranslator translator,
OperationObserver delegate,
boolean generatesKeys)
Executes batch as individual queries over the same prepared statement.
|
protected boolean |
supportsGeneratedKeys(boolean isBatch) |
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()
protected void runAsBatch(Connection con, BatchTranslator translator, OperationObserver delegate, boolean generatesKeys) 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 supportsGeneratedKeys(boolean isBatch)
protected boolean hasGeneratedKeys()
protected void processGeneratedKeys(Statement statement, OperationObserver observer, BatchQueryRow row) throws SQLException
SQLExceptionprotected void processGeneratedKeys(Statement statement, OperationObserver observer, List<BatchQueryRow> rows) throws SQLException
SQLExceptionCopyright © 2001–2021 Apache Cayenne. All rights reserved.