|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
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.
Constructor Summary | |
---|---|
JdbcUpdateAffectedIncorrectNumberOfRowsException(String sql,
int expected,
int actual)
Constructor for JdbcUpdateAffectedIncorrectNumberOfRowsException. |
Method Summary | |
---|---|
int |
getActualRowsAffected()
Return the number of rows that have actually been affected. |
int |
getExpectedRowsAffected()
Return the number of rows that should have been affected. |
boolean |
wasDataUpdated()
Return whether data was updated. |
Methods inherited from class org.springframework.core.NestedRuntimeException |
---|
contains, getCause, getMessage, getMostSpecificCause, getRootCause, printStackTrace, printStackTrace |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JdbcUpdateAffectedIncorrectNumberOfRowsException(String sql, int expected, int actual)
sql
- SQL we were tring to executeexpected
- the expected number of rows affectedactual
- the actual number of rows affectedMethod Detail |
---|
public int getExpectedRowsAffected()
public int getActualRowsAffected()
public boolean wasDataUpdated()
IncorrectUpdateSemanticsDataAccessException
The default implementation always returns true. This can be overridden in subclasses.
wasDataUpdated
in class IncorrectUpdateSemanticsDataAccessException
|
The Spring Framework | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |