As far as keeping validation logic in the entity itself, you can do something 
like this:


  | @Entity
  | @Name("foo")
  | @Table(name = "foo")
  | public class Foo implements Serializable {
  | ...
  |   @AssertTrue(message = "{invalid.nonRepeatCycle.message}")
  |   public boolean isNonRepeatCycleValid() {
  |     return nonRepeatCycle > 0;
  |   }
  | ...
  | }
  | 

It seems to me you're better of using Hibernate's validation framework rather 
than creating your own; I imagine you'd end up duplicating a lot of it.

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073762#4073762

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073762
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to