Class BatchingBatch
- java.lang.Object
-
- org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl
-
- org.hibernate.engine.jdbc.batch.internal.BatchingBatch
-
- All Implemented Interfaces:
Batch
public class BatchingBatch extends AbstractBatchImpl
ABatchimplementation which does bathing based on a given size. Once the batch size is reached for a statement in the batch, the entire batch is implicitly executed.
-
-
Constructor Summary
Constructors Constructor Description BatchingBatch(BatchKey key, JdbcCoordinator jdbcCoordinator, int batchSize)Constructs a BatchingBatch
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToBatch()Indicates completion of the current part of the batch.protected voiddoExecuteBatch()Perform batch execution..PreparedStatementgetBatchStatement(String sql, boolean callable)Get a statement which is part of the batch, creating if necessary (and storing for next time).-
Methods inherited from class org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl
abortBatch, addObserver, clearBatch, execute, getJdbcCoordinator, getKey, getStatements, notifyObserversExplicitExecution, notifyObserversImplicitExecution, release, releaseStatements, sqlExceptionHelper, sqlStatementLogger
-
-
-
-
Constructor Detail
-
BatchingBatch
public BatchingBatch(BatchKey key, JdbcCoordinator jdbcCoordinator, int batchSize)
Constructs a BatchingBatch- Parameters:
key- The batch keyjdbcCoordinator- The JDBC jdbcCoordinatorbatchSize- The batch size.
-
-
Method Detail
-
getBatchStatement
public PreparedStatement getBatchStatement(String sql, boolean callable)
Description copied from interface:BatchGet a statement which is part of the batch, creating if necessary (and storing for next time).- Specified by:
getBatchStatementin interfaceBatch- Overrides:
getBatchStatementin classAbstractBatchImpl- Parameters:
sql- The SQL statement.callable- Is the SQL statement callable?- Returns:
- The prepared statement instance, representing the SQL statement.
-
addToBatch
public void addToBatch()
Description copied from interface:BatchIndicates completion of the current part of the batch.
-
doExecuteBatch
protected void doExecuteBatch()
Description copied from class:AbstractBatchImplPerform batch execution.. This is called from the explicit execution, but may also be called from elsewhere depending on the exact implementation.- Specified by:
doExecuteBatchin classAbstractBatchImpl
-
-