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
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected Messagesprotected Notifications -
Constructor Summary
ConstructorsConstructorDescriptionUniqueConstraintViolationHandler(Messages messages, Notifications notifications) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoHandle(UniqueConstraintViolationException exception) protected StringgetDefaultMessage(String constraintName) protected StringgetMessage(String constraintName) booleanHandle 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:UiExceptionHandlerHandle an exception. Implementation class should either handle the exception and returntrue, or returnfalseto delegate execution to the next handler in the chain of responsibility.- Specified by:
handlein interfaceUiExceptionHandler- Parameters:
exception- throwable instance- Returns:
trueif the exception has been successfully handled,falseif not
-
doHandle
-
getMessage
-
getDefaultMessage
-