public class JdbcUpdateAffectedIncorrectNumberOfRowsException extends IncorrectUpdateSemanticsDataAccessException
Modifier and Type | Field and Description |
---|---|
private int |
actual
Number of rows that actually were affected
|
private int |
expected
Number of rows that should have been affected
|
Constructor and Description |
---|
JdbcUpdateAffectedIncorrectNumberOfRowsException(java.lang.String sql,
int expected,
int actual)
Constructor for JdbcUpdateAffectedIncorrectNumberOfRowsException.
|
Modifier and Type | Method and Description |
---|---|
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.
|
contains, getMessage, getMostSpecificCause, getRootCause
private int expected
private int actual
public JdbcUpdateAffectedIncorrectNumberOfRowsException(java.lang.String sql, int expected, int actual)
sql
- SQL we were tring to executeexpected
- the expected number of rows affectedactual
- the actual number of rows affectedpublic 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