public interface

Expectation

org.hibernate.jdbc.Expectation
Known Indirect Subclasses

Class Overview

Defines an expected DML operation outcome.

Summary

Public Methods
abstract boolean canBeBatched()
Is it acceptable to combiner this expectation with statement batching?
abstract int prepare(PreparedStatement statement)
Perform any special statement preparation.
abstract void verifyOutcome(int rowCount, PreparedStatement statement, int batchPosition)
Perform verification of the outcome of the RDBMS operation based on the type of expectation defined.

Public Methods

public abstract boolean canBeBatched ()

Is it acceptable to combiner this expectation with statement batching?

Returns
  • True if batching can be combined with this expectation; false otherwise.

public abstract int prepare (PreparedStatement statement)

Perform any special statement preparation.

Parameters
statement The statement to be prepared
Returns
  • The number of bind positions consumed (if any)
Throws
SQLException Exception from the JDBC driver
HibernateException Problem performing preparation.

public abstract void verifyOutcome (int rowCount, PreparedStatement statement, int batchPosition)

Perform verification of the outcome of the RDBMS operation based on the type of expectation defined.

Parameters
rowCount The RDBMS reported "number of rows affected".
statement The statement representing the operation
batchPosition The position in the batch (if batching)
Throws
SQLException Exception from the JDBC driver
HibernateException Problem processing the outcome.