Package org.hibernate.jdbc

Class Expectation.RowCount

    • Constructor Detail

      • RowCount

        public RowCount()
    • Method Detail

      • verifyOutcome

        public final void verifyOutcome​(int rowCount,PreparedStatement statement,                                int batchPosition,String sql)
        Description copied from interface: Expectation
        Perform verification of the outcome of the JDBC operation based on the type of expectation defined, after execution of the givenPreparedStatement. When a SQL statement is executed viaPreparedStatement.executeUpdate(),verifyOutcome() is called exactly once. WhenStatement.executeBatch() is used to execute a batch update, this method is called once for each element of the batch.
        • The argument torowCount is usually the number of table rows affected by execution of the SQL statement viaexecuteUpdate(). However, in the case whereexecuteBatch() is used to execute a batch update, it might beStatement.EXECUTE_FAILED orStatement.SUCCESS_NO_INFO.
        • The argument tobatchPosition is negative unlessexecuteBatch() is used to execute a batch update, in which case it is the position within the batch of the row count being verified.
        Specified by:
        verifyOutcome in interface Expectation
        Parameters:
        rowCount - The RDBMS reported "number of rows affected"
        statement - The statement representing the operation
        batchPosition - The position in the batch (if batching), or-1 if not part of a batch
        sql - The SQL backing the prepared statement, for error reporting and logging purposes
        See Also:
        PreparedStatement.executeUpdate(),Statement.executeBatch()
      • expectedRowCount

        protected int expectedRowCount()