Package io.jmix.flowuidata.exception
Class UniqueConstraintViolationHandler
java.lang.Object
io.jmix.flowuidata.exception.UniqueConstraintViolationHandler
- All Implemented Interfaces:
UiExceptionHandler
@Component("flowui_UniqueConstraintViolationHandler")
@Order(160)
public class UniqueConstraintViolationHandler
extends Object
implements UiExceptionHandler
Handles database unique constraint violations. Determines the exception type by searching a special marker string
in the messages of all exceptions in the chain.
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected Messages
protected Notifications
-
Constructor Summary
ConstructorDescriptionUniqueConstraintViolationHandler
(Messages messages, Notifications notifications) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
doHandle
(UniqueConstraintViolationException exception) protected String
getDefaultMessage
(String constraintName) protected String
getMessage
(String constraintName) boolean
Handle an exception.
-
Field Details
-
DEFAULT_MESSAGE_PROPERTY
- See Also:
-
MESSAGE_PREFIX
- See Also:
-
messages
-
notifications
-
-
Constructor Details
-
UniqueConstraintViolationHandler
-
-
Method Details
-
handle
Description copied from interface:UiExceptionHandler
Handle an exception. Implementation class should either handle the exception and returntrue
, or returnfalse
to delegate execution to the next handler in the chain of responsibility.- Specified by:
handle
in interfaceUiExceptionHandler
- Parameters:
exception
- throwable instance- Returns:
true
if the exception has been successfully handled,false
if not
-
doHandle
-
getMessage
-
getDefaultMessage
-