This content has been marked as final.
Show 3 replies
-
1. Re: Hibernate validations on seam components
ygardas Dec 7, 2009 10:11 AM (in response to ygardas)Hi,
I need help in solving this issue!
Please suggest me some solution.
-
2. Re: Hibernate validations on seam components
mgbowman Dec 7, 2009 2:19 PM (in response to ygardas)Try adding @Valid to the classTwo property in ClassOne
ClassOne.java
@Name("classone") @Scope(ScopeType.CONVERSATION) @Entity @AutoCreate @Table(name = "classone", schema = "demo") @Inheritance(strategy = InheritanceType.JOINED) public class ClassOne implements Serializable { // snip @Valid // <-- tell Hibernate to additionally validate ClassTwo private ClassTwo classTwo; // snip }
If that alone doesn't work, the only other thing I can think it could be is that you're missing @OneToOne on classTwo making Hibernate unaware that ClassOne and ClassTwo are related. You may need to add @OneToOne
ClassOne.java
@Name("classone") @Scope(ScopeType.CONVERSATION) @Entity @AutoCreate @Table(name = "classone", schema = "demo") @Inheritance(strategy = InheritanceType.JOINED) public class ClassOne implements Serializable { // snip @OneToOne // <-- tell Hibernate the two entities are related @Valid // <-- tell Hibernate to additionally validate ClassTwo private ClassTwo classTwo; // snip }
Hope this helps!
--mgbowman
-
3. Re: Hibernate validations on seam components
ygardas Dec 8, 2009 8:18 AM (in response to ygardas)Hi,
The annotations helped me!
Thanks a lot!