Class BeanValidationEventListener
java.lang.Object
org.hibernate.boot.beanvalidation.BeanValidationEventListener
- All Implemented Interfaces:
PreDeleteEventListener
,PreInsertEventListener
,PreUpdateEventListener
,PreUpsertEventListener
public class BeanValidationEventListener
extends Object
implements PreInsertEventListener, PreUpdateEventListener, PreDeleteEventListener, PreUpsertEventListener
Event listener used to enable Bean Validation for insert/update/delete events.
-
Constructor Summary
ConstructorsConstructorDescriptionBeanValidationEventListener
(ValidatorFactory factory, Map<String, Object> settings, ClassLoaderService classLoaderService) Constructor used in an environment where validator factory is injected (JPA2). -
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(Map<String, Object> settings, ClassLoaderService classLoaderService) boolean
onPreDelete
(PreDeleteEvent event) Return true if the operation should be vetoedboolean
onPreInsert
(PreInsertEvent event) Return true if the operation should be vetoedboolean
onPreUpdate
(PreUpdateEvent event) Return true if the operation should be vetoedboolean
onPreUpsert
(PreUpsertEvent event) Return true if the operation should be vetoed
-
Constructor Details
-
BeanValidationEventListener
public BeanValidationEventListener(ValidatorFactory factory, Map<String, Object> settings, ClassLoaderService classLoaderService) Constructor used in an environment where validator factory is injected (JPA2).- Parameters:
factory
- TheValidatorFactory
to use to createValidator
instance(s)settings
- Configured properties
-
-
Method Details
-
initialize
-
onPreInsert
Description copied from interface:PreInsertEventListener
Return true if the operation should be vetoed- Specified by:
onPreInsert
in interfacePreInsertEventListener
-
onPreUpdate
Description copied from interface:PreUpdateEventListener
Return true if the operation should be vetoed- Specified by:
onPreUpdate
in interfacePreUpdateEventListener
-
onPreDelete
Description copied from interface:PreDeleteEventListener
Return true if the operation should be vetoed- Specified by:
onPreDelete
in interfacePreDeleteEventListener
-
onPreUpsert
Description copied from interface:PreUpsertEventListener
Return true if the operation should be vetoed- Specified by:
onPreUpsert
in interfacePreUpsertEventListener
-