1 Reply Latest reply on Jul 27, 2008 1:48 PM by Pete Muir

    Seam and Hibernate Validators

    System Administrator Expert
      After reading the validation section in chapter 17 of Bauer & King, I'm still not sure about the following:

      when you use Hibernate Validators on your entity classes, does Seam fire client-side validations, server-side validations, or both?

      when you use the JSF validations in your xhtml markup, then the validations are executed in the process validations phase of the JSF life cycle.

      is this true for hibernate validations as well?

      if it's server-side, then when does it happen (before an EJB method with transactional support is fired?)  and what if your component method doing the CRUD operation is not running in a transaction?
        • 1. Re: Seam and Hibernate Validators
          Pete Muir Master

          Arbi Sookazian wrote on Jul 21, 2008 16:33:


          when you use Hibernate Validators on your entity classes, does Seam fire client-side validations, server-side validations, or both?

          when you use the JSF validations in your xhtml markup, then the validations are executed in the process validations phase of the JSF life cycle.

          is this true for hibernate validations as well?




          If you use <s:validate /> Seam will add a JSF valdiator (which executes in the JSF process validations phase) which delegates to Hibernate validator for client side validation, Hibernate handles validation in your persistence layer





          if it's server-side, then when does it happen (before an EJB method with transactional support is fired?)  and what if your component method doing the CRUD operation is not running in a transaction?


          It happens when Hibernate tries to persist the entity.