2 Replies Latest reply on Mar 5, 2007 4:02 AM by Philipp Straub

    Disable event-based validation

    Philipp Straub Newbie

      Hi,

      I'd like to use Hibernate validation only at application level (i.e. in code and with s:validateAll). Is there a way to disable the ValidateEventListener, i.e. event-based validation? If so, how can I do this?

      Thanks!

        • 1. Re: Disable event-based validation
          Pete Muir Master

          Ask this on the hibernate JSR-220 forum.

          • 2. Re: Disable event-based validation
            Philipp Straub Newbie

            Now I know! For anyone who is interested:

            You can overwrite the default use of org.hibernate.secure.JACCPreInsertEventListener and org.hibernate.valitator.event.ValidateEventListener for the pre-insert event and org.hibernate.secure.JACCPreUpdateEventListener, org.hibernate.valitator.event.ValidateEventListener for the pre-update event by adding those lines to the persistence.xml:

            <property name="hibernate.ejb.event.pre-insert" value="org.hibernate.secure.JACCPreInsertEventListener"/>
            <property name="hibernate.ejb.event.pre-update" value="org.hibernate.secure.JACCPreUpdateEventListener"/>