Top Description Methods
org.hibernate.engine.jdbc.batch.spi

public Interface Batch

Known Direct Implementers
org.hibernate.engine.jdbc.batch.internal.BatchImpl
Annotations
@Incubating
Imports
java.sql.PreparedStatement, java.util.function.Supplier, org.hibernate.Incubating, org.hibernate.engine.jdbc.mutation.JdbcValueBindings, .TableInclusionChecker, org.hibernate.engine.jdbc.mutation.group.PreparedStatementGroup

Represents a batch of statements to be executed together.

Unlike in JDBC, here we add the ability to batch together multiple statements at a time. In the underlying JDBC this correlates to multiple PreparedStatement objects, one for each DML string, all maintained within the batch.

A batch is usually associated with a org.hibernate.engine.jdbc.spi.JdbcCoordinator.

Author
Steve Ebersole
See Also
org.hibernate.engine.jdbc.spi.JdbcCoordinator#getBatch(BatchKey, Integer, Supplier)

Method Summary

Modifier and TypeMethod and Description
public void
addObserver(BatchObserver
The batch observer.
observer
)

Adds an observer to this batch.

public void
addToBatch(JdbcValueBindings jdbcValueBindings, TableInclusionChecker inclusionChecker)

Apply the value bindings to the batch JDBC statements and indicates completion of the current part of the batch.

public void
execute()

Execute this batch.

public BatchKey

Returns:

The batch key.
getKey
()

Retrieves the object being used to key (uniquely identify) this batch.

public PreparedStatementGroup
public void
release()

Used to indicate that the batch instance is no longer needed and that, therefore, it can release its resources.

Method Detail

addObserverback to summary
public void addObserver(BatchObserver observer)

Adds an observer to this batch.

Parameters
observer:BatchObserver

The batch observer.

addToBatchback to summary
public void addToBatch(JdbcValueBindings jdbcValueBindings, TableInclusionChecker inclusionChecker)

Apply the value bindings to the batch JDBC statements and indicates completion of the current part of the batch.

executeback to summary
public void execute()

Execute this batch.

getKeyback to summary
public BatchKey getKey()

Retrieves the object being used to key (uniquely identify) this batch.

Returns:BatchKey

The batch key.

getStatementGroupback to summary
public PreparedStatementGroup getStatementGroup()
releaseback to summary
public void release()

Used to indicate that the batch instance is no longer needed and that, therefore, it can release its resources.