Class BeanValidationEventListener
- java.lang.Object
-
- org.hibernate.boot.beanvalidation.BeanValidationEventListener
-
- All Implemented Interfaces:
PreCollectionUpdateEventListener,PreDeleteEventListener,PreInsertEventListener,PreUpdateEventListener,PreUpsertEventListener
public class BeanValidationEventListener extends Object implements PreInsertEventListener, PreUpdateEventListener, PreDeleteEventListener, PreUpsertEventListener, PreCollectionUpdateEventListener
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 voidinitialize(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 vetoedvoidonPreUpdateCollection(PreCollectionUpdateEvent event)booleanonPreUpsert(PreUpsertEvent 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- TheValidatorFactoryto use to createValidatorinstance(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:PreInsertEventListenerReturn true if the operation should be vetoed- Specified by:
onPreInsertin interfacePreInsertEventListener
-
onPreUpdate
public boolean onPreUpdate(PreUpdateEvent event)
Description copied from interface:PreUpdateEventListenerReturn true if the operation should be vetoed- Specified by:
onPreUpdatein interfacePreUpdateEventListener
-
onPreDelete
public boolean onPreDelete(PreDeleteEvent event)
Description copied from interface:PreDeleteEventListenerReturn true if the operation should be vetoed- Specified by:
onPreDeletein interfacePreDeleteEventListener
-
onPreUpsert
public boolean onPreUpsert(PreUpsertEvent event)
Description copied from interface:PreUpsertEventListenerReturn true if the operation should be vetoed- Specified by:
onPreUpsertin interfacePreUpsertEventListener
-
onPreUpdateCollection
public void onPreUpdateCollection(PreCollectionUpdateEvent event)
- Specified by:
onPreUpdateCollectionin interfacePreCollectionUpdateEventListener
-
-