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

    Disable event-based validation

    straubp

      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
          pmuir

          Ask this on the hibernate JSR-220 forum.

          • 2. Re: Disable event-based validation
            straubp

            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"/>