public class SQLStateResolver extends Object implements PersistenceExceptionResolver
Constructor and Description |
---|
SQLStateResolver()
Constructor that uses the standard SQL state category for the check.
|
SQLStateResolver(String checkState)
Constructor that can be used to supply a specific SQL state code for the check.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isDuplicateKeyViolation(Exception exception)
Indicates whether the given
exception represents a duplicate key violation. |
public SQLStateResolver()
public SQLStateResolver(String checkState)
checkState
- The state string that is used in the check.public boolean isDuplicateKeyViolation(Exception exception)
PersistenceExceptionResolver
exception
represents a duplicate key violation. Typically, duplicate key
violations indicates concurrent access to an entity in the application. Two users might be accessing the same
Aggregate, for example.isDuplicateKeyViolation
in interface PersistenceExceptionResolver
exception
- The exception to evaluatetrue
if the given exception represents a Duplicate Key Violation, false
otherwise.Copyright © 2010–2024. All rights reserved.