Package org.hibernate.jdbc
Interface Expectation
-
- All Known Implementing Classes:
Expectations.BasicExpectation
,Expectations.BasicParamExpectation
public interface Expectation
Defines an expected DML operation outcome.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canBeBatched()
Is it acceptable to combiner this expectation with statement batching?int
prepare(java.sql.PreparedStatement statement)
Perform any special statement preparation.void
verifyOutcome(int rowCount, java.sql.PreparedStatement statement, int batchPosition)
Perform verification of the outcome of the RDBMS operation based on the type of expectation defined.
-
-
-
Method Detail
-
verifyOutcome
void verifyOutcome(int rowCount, java.sql.PreparedStatement statement, int batchPosition) throws java.sql.SQLException, HibernateException
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 operationbatchPosition
- The position in the batch (if batching)- Throws:
java.sql.SQLException
- Exception from the JDBC driverHibernateException
- Problem processing the outcome.
-
prepare
int prepare(java.sql.PreparedStatement statement) throws java.sql.SQLException, HibernateException
Perform any special statement preparation.- Parameters:
statement
- The statement to be prepared- Returns:
- The number of bind positions consumed (if any)
- Throws:
java.sql.SQLException
- Exception from the JDBC driverHibernateException
- Problem performing preparation.
-
canBeBatched
boolean canBeBatched()
Is it acceptable to combiner this expectation with statement batching?- Returns:
- True if batching can be combined with this expectation; false otherwise.
-
-