Top Description Methods
org.hibernate.jdbc

public Interface Expectation

Known Direct Implementers
org.hibernate.jdbc.Expectations.BasicExpectation
Imports
org.hibernate.HibernateException, java.sql.SQLException, .PreparedStatement

Defines an expected DML operation outcome.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if batching can be combined with this expectation; false otherwise.
canBeBatched
()

Is it acceptable to combiner this expectation with statement batching?

public int

Returns:

The number of bind positions consumed (if any)
prepare
(PreparedStatement
The statement to be prepared
statement
)

Perform any special statement preparation.

public void
verifyOutcome(int
The RDBMS reported "number of rows affected".
rowCount
,
PreparedStatement
The statement representing the operation
statement
,
int
The position in the batch (if batching)
batchPosition
)

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

Method Detail

canBeBatchedback to summary
public boolean canBeBatched()

Is it acceptable to combiner this expectation with statement batching?

Returns:boolean

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

prepareback to summary
public int prepare(PreparedStatement statement) throws SQLException, HibernateException

Perform any special statement preparation.

Parameters
statement:PreparedStatement

The statement to be prepared

Returns:int

The number of bind positions consumed (if any)

Exceptions
SQLException:
Exception from the JDBC driver
HibernateException:
Problem performing preparation.
verifyOutcomeback to summary
public void verifyOutcome(int rowCount, PreparedStatement statement, int batchPosition) throws SQLException, HibernateException

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

Parameters
rowCount:int

The RDBMS reported "number of rows affected".

statement:PreparedStatement

The statement representing the operation

batchPosition:int

The position in the batch (if batching)

Exceptions
SQLException:
Exception from the JDBC driver
HibernateException:
Problem processing the outcome.