java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
st.orm.PersistenceException
st.orm.UnexpectedRowCountException
- All Implemented Interfaces:
Serializable
Thrown when a write affects a different number of rows than it expects: an insert, update or remove of an entity
that affects no row, or a batch whose affected row count differs from its size.
Storm detects this after the statement ran, so it passes through the template's exception mapper like a
failure the database reported. An update of a versioned entity that affects no row is an
OptimisticLockException instead.
- Since:
- 1.16
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUnexpectedRowCountException(String message, int expectedRowCount, int actualRowCount) Constructs a new exception with the specified detail message and row counts. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of rows the write affected, as the driver reported it.intReturns the number of rows the write expected to affect.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
UnexpectedRowCountException
Constructs a new exception with the specified detail message and row counts.- Parameters:
message- the detail message.expectedRowCount- the number of rows the write expected to affect.actualRowCount- the number of rows the write affected.
-
-
Method Details
-
getExpectedRowCount
public int getExpectedRowCount()Returns the number of rows the write expected to affect.- Returns:
- the expected row count.
-
getActualRowCount
public int getActualRowCount()Returns the number of rows the write affected, as the driver reported it. For a batch, this is the sum of the counts the driver reported per statement.- Returns:
- the actual row count.
-