Package org.hibernate.jdbc
Class Expectations.BasicParamExpectation
- java.lang.Object
-
- org.hibernate.jdbc.Expectations.BasicExpectation
-
- org.hibernate.jdbc.Expectations.BasicParamExpectation
-
- All Implemented Interfaces:
Expectation
- Enclosing class:
- Expectations
public static class Expectations.BasicParamExpectation extends Expectations.BasicExpectation
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BasicParamExpectation(int expectedRowCount, int parameterPosition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeBatched()
Is it acceptable to combine this expectation with statement batching?protected int
determineRowCount(int reportedRowCount, PreparedStatement statement)
int
getNumberOfParametersUsed()
The number of parameters this expectation implies.int
prepare(PreparedStatement statement)
Perform any special statement preparation.-
Methods inherited from class org.hibernate.jdbc.Expectations.BasicExpectation
verifyOutcome
-
-
-
-
Method Detail
-
getNumberOfParametersUsed
public int getNumberOfParametersUsed()
Description copied from interface:Expectation
The number of parameters this expectation implies. E.g.,Expectations.BasicParamExpectation
requires a single OUT parameter for reading back the number of affected rows.
-
prepare
public int prepare(PreparedStatement statement) throws SQLException, HibernateException
Description copied from interface:Expectation
Perform any special statement preparation.- Specified by:
prepare
in interfaceExpectation
- Overrides:
prepare
in classExpectations.BasicExpectation
- Parameters:
statement
- The statement to be prepared- Returns:
- The number of bind positions consumed (if any)
- Throws:
SQLException
- Exception from the JDBC driverHibernateException
- Problem performing preparation.
-
canBeBatched
public boolean canBeBatched()
Description copied from interface:Expectation
Is it acceptable to combine this expectation with statement batching?- Specified by:
canBeBatched
in interfaceExpectation
- Overrides:
canBeBatched
in classExpectations.BasicExpectation
- Returns:
- True if batching can be combined with this expectation; false otherwise.
-
determineRowCount
protected int determineRowCount(int reportedRowCount, PreparedStatement statement)
- Overrides:
determineRowCount
in classExpectations.BasicExpectation
-
-