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.NonTransientDataAccessException
org.springframework.dao.InvalidDataAccessResourceUsageException
org.springframework.dao.IncorrectUpdateSemanticsDataAccessException
org.springframework.jdbc.JdbcUpdateAffectedIncorrectNumberOfRowsException
- All Implemented Interfaces:
- java.io.Serializable
public class JdbcUpdateAffectedIncorrectNumberOfRowsException
- extends org.springframework.dao.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, Juergen Hoeller
- See Also:
- Serialized Form
Methods inherited from class org.springframework.core.NestedRuntimeException |
contains, getMessage, getMostSpecificCause, getRootCause |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
JdbcUpdateAffectedIncorrectNumberOfRowsException
public JdbcUpdateAffectedIncorrectNumberOfRowsException(java.lang.String sql,
int expected,
int actual)
- Constructor for JdbcUpdateAffectedIncorrectNumberOfRowsException.
- Parameters:
sql
- SQL we were tring to executeexpected
- the expected number of rows affectedactual
- the actual number of rows affected
getExpectedRowsAffected
public int getExpectedRowsAffected()
- Return the number of rows that should have been affected.
getActualRowsAffected
public int getActualRowsAffected()
- Return the number of rows that have actually been affected.
wasDataUpdated
public boolean wasDataUpdated()
- Overrides:
wasDataUpdated
in class org.springframework.dao.IncorrectUpdateSemanticsDataAccessException