0 Replies Latest reply on Jan 27, 2010 9:23 PM by carvo

    Extend Seam-Hibernate Validation (more over)

    carvo

      Hi.


      I have a project that was generate by JbossTools (Seam 2.2 and JbossAS 5.1). Others files (like FooHome.java, FooList.java, FooEdit.xhtml, etc) was generate too.


      I'm using a custon hibernate validator for unique values (from this post
        My Link ).
      But all the validations that returns FALSE, throws the org.hibernate.validator.InvalidStateException.


      I saw this post My Link and try to implement the Dan Allen suggestion. But if the EntityHome returns invalid, the edit form is sent with the error message and the fields populated. However, by altering this form (with valid values) and try to save it again, apparently the Hibernate validation works normally but the EntityHome try to insert the old and invalid values (as if there were two objects), throwing the exception PersistenceException (because the integrity of the database).


      How can I fix it??
      Which is the best way to do that kind of validation??


      Thanks in advance,
      CARVO.
      carvo33@hotmail.com