Thanks 4 the reply Fer! This works great. anonymous wrote : | I don't know what exactly you mean with "without mapping that to the database" | Sorry about that. I want to validate this uniqueness in my models. But is also great to have then validated in the database to. But in some weird case where my validation require some kind of twisted logic using some properties from the Person entity and all the other entities already persisted, is there a clean way to add this logic in the model? Or this is conceptually wrong? I think that using an Staless or Statefull bean for this kind of validation may mix up the controller with the model.
Pleas correct me. The validation you gave me works great. The only complain is that a get some error logs about: | 10:36:54,795 ERROR [JDBCExceptionReporter] ERROR: duplicate key violates unique constraint "person_name_key" | 10:36:54,795 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session | org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update | at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71) | at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) | Which is a little annoying :) Thanks again Hey, i'm your neighbor! From Paraguay :D View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049060#4049060 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049060 _______________________________________________ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user