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.
- Author:
- Emmanuel Bernard, Hardy Ferentschik
-
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 TypeMethodDescriptionvoidinitialize(Map<String, Object> settings, ClassLoaderService classLoaderService) booleanonPreDelete(PreDeleteEvent event) Return true if the operation should be vetoedbooleanonPreInsert(PreInsertEvent event) Return true if the operation should be vetoedbooleanonPreUpdate(PreUpdateEvent event) Return true if the operation should be vetoedbooleanonPreUpsert(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- TheValidatorFactoryto use to createValidatorinstance(s)settings- Configured properties
-
-
Method Details
-
initialize
-
onPreInsert
Description copied from interface:PreInsertEventListenerReturn true if the operation should be vetoed- Specified by:
onPreInsertin interfacePreInsertEventListener
-
onPreUpdate
Description copied from interface:PreUpdateEventListenerReturn true if the operation should be vetoed- Specified by:
onPreUpdatein interfacePreUpdateEventListener
-
onPreDelete
Description copied from interface:PreDeleteEventListenerReturn true if the operation should be vetoed- Specified by:
onPreDeletein interfacePreDeleteEventListener
-
onPreUpsert
Description copied from interface:PreUpsertEventListenerReturn true if the operation should be vetoed- Specified by:
onPreUpsertin interfacePreUpsertEventListener
-