org.springframework.jdbc
Class JdbcUpdateAffectedIncorrectNumberOfRowsException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--org.springframework.core.NestedRuntimeException
                          |
                          +--org.springframework.dao.DataAccessException
                                |
                                +--org.springframework.dao.InvalidDataAccessResourceUsageException
                                      |
                                      +--org.springframework.dao.IncorrectUpdateSemanticsDataAccessException
                                            |
                                            +--org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException

public class JdbcUpdateAffectedIncorrectNumberOfRowsException
extends IncorrectUpdateSemanticsDataAccessException

Exception thrown when a JDBC update affects an unexpected number of rows. Typically we expect an update to affect a single row, meaning it's an error if it affects multiple rows.

Author:
Rod Johnson

Constructor Summary
JdbcUpdateAffectedIncorrectNumberOfRowsException(String sql, int expected, int actual)
           

Method Summary
 intgetActualRowsAffected()
           
 booleangetDataWasUpdated()
           
 intgetExpectedRowsAffected()
           

Methods inherited from class org.springframework.core.NestedRuntimeException
getCause, getMessage, printStackTrace, printStackTrace

Methods inherited from class java.lang.Throwable
printStackTrace, getStackTrace, setStackTrace, getLocalizedMessage, toString, fillInStackTrace, initCause

Methods inherited from class java.lang.Object
hashCode, notify, notifyAll, wait, wait, wait, getClass, equals

Constructor Detail

JdbcUpdateAffectedIncorrectNumberOfRowsException

public JdbcUpdateAffectedIncorrectNumberOfRowsException(String sql, int expected, int actual)
Method Detail

getActualRowsAffected

public int getActualRowsAffected()

getDataWasUpdated

public boolean getDataWasUpdated()

getExpectedRowsAffected

public int getExpectedRowsAffected()