public class DefaultJdbcOptimisticLockingExceptionMapper extends Object implements JdbcOptimisticLockingExceptionMapper
JdbcOptimisticLockingExceptionMapper
which checks the caused exception (and its nested)
whether any of them is a constraint violation exception.
The following check is done:
SQLException
DataIntegrityViolationException
addClassName(String)
or setClassNames(java.util.Set)
methods. These class names is also matched. This allows to add vendor specific exception classes.Constructor and Description |
---|
DefaultJdbcOptimisticLockingExceptionMapper() |
Modifier and Type | Method and Description |
---|---|
void |
addClassName(String name) |
static boolean |
isConstraintViolation(SQLException e) |
boolean |
isOptimisticLocking(Exception cause)
Checks the caused exception whether its to be considered as an
JdbcAggregationRepository.OptimisticLockingException . |
void |
setClassNames(Set<String> names) |
public DefaultJdbcOptimisticLockingExceptionMapper()
public boolean isOptimisticLocking(Exception cause)
JdbcOptimisticLockingExceptionMapper
JdbcAggregationRepository.OptimisticLockingException
.isOptimisticLocking
in interface JdbcOptimisticLockingExceptionMapper
cause
- the caused exceptionJdbcAggregationRepository.OptimisticLockingException
.public static boolean isConstraintViolation(SQLException e)
public void addClassName(String name)
Apache Camel