Class BeanValidationEventListener
- java.lang.Object
-
- org.hibernate.boot.beanvalidation.BeanValidationEventListener
-
- All Implemented Interfaces:
PreDeleteEventListener
,PreInsertEventListener
,PreUpdateEventListener
public class BeanValidationEventListener extends Object implements PreInsertEventListener, PreUpdateEventListener, PreDeleteEventListener
Event listener used to enable Bean Validation for insert/update/delete events.
-
-
Constructor Summary
Constructors Constructor Description BeanValidationEventListener(ValidatorFactory factory, Map<String,Object> settings, ClassLoaderService classLoaderService)
Constructor used in an environment where validator factory is injected (JPA2).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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 vetoed
-
-
-
Constructor Detail
-
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 Detail
-
initialize
public void initialize(Map<String,Object> settings, ClassLoaderService classLoaderService)
-
onPreInsert
public boolean onPreInsert(PreInsertEvent event)
Description copied from interface:PreInsertEventListener
Return true if the operation should be vetoed- Specified by:
onPreInsert
in interfacePreInsertEventListener
-
onPreUpdate
public boolean onPreUpdate(PreUpdateEvent event)
Description copied from interface:PreUpdateEventListener
Return true if the operation should be vetoed- Specified by:
onPreUpdate
in interfacePreUpdateEventListener
-
onPreDelete
public boolean onPreDelete(PreDeleteEvent event)
Description copied from interface:PreDeleteEventListener
Return true if the operation should be vetoed- Specified by:
onPreDelete
in interfacePreDeleteEventListener
-
-