Top Description Fields Constructors Methods
org.hibernate.engine.jdbc.batch.internal

public Class BatchingBatch

extends AbstractBatchImpl
Class Inheritance
Imports
java.sql.PreparedStatement, .SQLException, java.util.Map, org.hibernate.HibernateException, org.hibernate.engine.jdbc.batch.spi.BatchKey, org.hibernate.engine.jdbc.spi.JdbcCoordinator, org.hibernate.internal.CoreMessageLogger, org.hibernate.resource.jdbc.spi.JdbcObserver, org.jboss.logging.Logger

A org.hibernate.engine.jdbc.batch.spi.Batch implementation 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.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private boolean
private int
private int
private final int
private PreparedStatement
private String
private static final CoreMessageLogger
private int

Constructor Summary

AccessConstructor and Description
public
BatchingBatch(BatchKey
The batch key
key
,
JdbcCoordinator
The JDBC jdbcCoordinator
jdbcCoordinator
,
int
The batch size.
batchSize
)

Constructs a BatchingBatch

Method Summary

Modifier and TypeMethod and Description
public void
addToBatch()

Implements org.hibernate.engine.jdbc.batch.spi.Batch.addToBatch.

Indicates completion of the current part of the batch.
private void
checkRowCounts(int[] rowCounts, PreparedStatement ps, String statementSQL)

protected void
public PreparedStatement
getBatchStatement(String
The SQL statement.
sql
,
boolean
Is the SQL statement callable?
callable
)

Overrides org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.getBatchStatement.

Implements org.hibernate.engine.jdbc.batch.spi.Batch.getBatchStatement.

Get a statement which is part of the batch, creating if necessary (and storing for next time).
private void
Inherited from org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl:
abortBatchaddObserverclearBatchexecutegetJdbcCoordinatorgetKeygetStatementsnotifyObserversExplicitExecutionnotifyObserversImplicitExecutionreleasereleaseStatementssqlExceptionHelpersqlStatementLogger

Field Detail

batchExecutedback to summary
private boolean batchExecuted
batchPositionback to summary
private int batchPosition
batchSizeback to summary
private int batchSize
configuredBatchSizeback to summary
private final int configuredBatchSize
currentStatementback to summary
private PreparedStatement currentStatement
currentStatementSqlback to summary
private String currentStatementSql
LOGback to summary
private static final CoreMessageLogger LOG

Hides org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.LOG.

statementPositionback to summary
private int statementPosition

Constructor Detail

BatchingBatchback to summary
public BatchingBatch(BatchKey key, JdbcCoordinator jdbcCoordinator, int batchSize)

Constructs a BatchingBatch

Parameters
key:BatchKey

The batch key

jdbcCoordinator:JdbcCoordinator

The JDBC jdbcCoordinator

batchSize:int

The batch size.

Method Detail

addToBatchback to summary
public void addToBatch()

Implements org.hibernate.engine.jdbc.batch.spi.Batch.addToBatch.

Doc from org.hibernate.engine.jdbc.batch.spi.Batch.addToBatch.

Indicates completion of the current part of the batch.

Annotations
@Override
checkRowCountsback to summary
private void checkRowCounts(int[] rowCounts, PreparedStatement ps, String statementSQL) throws SQLException, HibernateException
doExecuteBatchback to summary
protected void doExecuteBatch()

Implements abstract org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.doExecuteBatch.

Doc from org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.doExecuteBatch.

Perform batch execution..

This is called from the explicit execution, but may also be called from elsewhere depending on the exact implementation.

Annotations
@Override
getBatchStatementback to summary
public PreparedStatement getBatchStatement(String sql, boolean callable)

Overrides org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl.getBatchStatement.

Implements org.hibernate.engine.jdbc.batch.spi.Batch.getBatchStatement.

Doc from org.hibernate.engine.jdbc.batch.spi.Batch.getBatchStatement.

Get a statement which is part of the batch, creating if necessary (and storing for next time).

Parameters
sql:String

The SQL statement.

callable:boolean

Is the SQL statement callable?

Returns:PreparedStatement

The prepared statement instance, representing the SQL statement.

Annotations
@Override
performExecutionback to summary
private void performExecution()