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

public Interface Batch

Known Direct Implementers
org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl
Imports
java.sql.PreparedStatement

Conceptually models a batch.

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

Author
Steve Ebersole

Method Summary

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

Adds an observer to this batch.

public void
addToBatch()

Indicates completion of the current part of the batch.

public void
execute()

Execute this batch.

public PreparedStatement

Returns:

The prepared statement instance, representing the SQL statement.
getBatchStatement
(String
The SQL statement.
sql
,
boolean
Is the SQL statement callable?
callable
)

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

public BatchKey

Returns:

The batch key.
getKey
()

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

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()

Indicates completion of the current part of the batch.

executeback to summary
public void execute()

Execute this batch.

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

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.

getKeyback to summary
public BatchKey getKey()

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

Returns:BatchKey

The batch key.

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.