Class BeanValidationEventListener
java.lang.Object
org.hibernate.boot.beanvalidation.BeanValidationEventListener
- All Implemented Interfaces:
Serializable,PreCollectionUpdateEventListener,PreDeleteEventListener,PreInsertEventListener,PreUpdateEventListener,PreUpsertEventListener,SessionFactoryObserver
public class BeanValidationEventListener
extends Object
implements PreInsertEventListener, PreUpdateEventListener, PreDeleteEventListener, PreUpsertEventListener, PreCollectionUpdateEventListener, SessionFactoryObserver
Event listener used to enable Bean Validation for insert/update/delete events.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBeanValidationEventListener(ValidatorFactory factory, Map<String, Object> settings, ClassLoaderService classLoaderService) -
Method Summary
Modifier and TypeMethodDescriptionbooleanonPreDelete(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 vetoedvoidbooleanonPreUpsert(PreUpsertEvent event) Return true if the operation should be vetoedvoidsessionFactoryCreated(SessionFactory factory) Callback to indicate that the given factory has been created and is now ready for use.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.SessionFactoryObserver
sessionFactoryClosed, sessionFactoryClosing
-
Constructor Details
-
BeanValidationEventListener
public BeanValidationEventListener(ValidatorFactory factory, Map<String, Object> settings, ClassLoaderService classLoaderService)
-
-
Method Details
-
sessionFactoryCreated
Description copied from interface:SessionFactoryObserverCallback to indicate that the given factory has been created and is now ready for use.- Specified by:
sessionFactoryCreatedin interfaceSessionFactoryObserver- Parameters:
factory- The factory initialized.
-
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
-
onPreUpdateCollection
- Specified by:
onPreUpdateCollectionin interfacePreCollectionUpdateEventListener
-