public class

BeanValidationEventListener

extends Object
implements Initializable PreDeleteEventListener PreInsertEventListener PreUpdateEventListener
java.lang.Object
   ↳ org.hibernate.cfg.beanvalidation.BeanValidationEventListener

Class Overview

Event listener used to enable Bean Validation for insert/update/delete events.

Summary

Public Constructors
BeanValidationEventListener()
No-arg constructor used when listener is configured via configuration file
BeanValidationEventListener(ValidatorFactory factory, Properties properties)
Constructor used in an environment where validator factory is injected (JPA2).
Public Methods
void initialize(Configuration cfg)
boolean onPreDelete(PreDeleteEvent event)
Return true if the operation should be vetoed
boolean onPreInsert(PreInsertEvent event)
Return true if the operation should be vetoed
boolean onPreUpdate(PreUpdateEvent event)
Return true if the operation should be vetoed
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.hibernate.event.Initializable
From interface org.hibernate.event.PreDeleteEventListener
From interface org.hibernate.event.PreInsertEventListener
From interface org.hibernate.event.PreUpdateEventListener

Public Constructors

public BeanValidationEventListener ()

No-arg constructor used when listener is configured via configuration file

public BeanValidationEventListener (ValidatorFactory factory, Properties properties)

Constructor used in an environment where validator factory is injected (JPA2).

Parameters
factory The ValidatorFactory to use to create Validator instance(s)
properties Configued properties

Public Methods

public void initialize (Configuration cfg)

public boolean onPreDelete (PreDeleteEvent event)

Return true if the operation should be vetoed

public boolean onPreInsert (PreInsertEvent event)

Return true if the operation should be vetoed

public boolean onPreUpdate (PreUpdateEvent event)

Return true if the operation should be vetoed