This content has been marked as final.
Show 4 replies
-
1. Re: Custom validators vs Hibernate validators
monkeyden Feb 10, 2011 9:21 AM (in response to mikael.brodd)Did you add the EntityListener?
@Entity @Table("USERS") @EntityListeners({JPAValidateListener.class}) public class User { ... }
-
2. Re: Custom validators vs Hibernate validators
mikael.brodd Feb 10, 2011 10:02 AM (in response to mikael.brodd)
Kyle Burke wrote on Feb 10, 2011 09:21:
Did you add the EntityListener?@Entity @Table("USERS") @EntityListeners({JPAValidateListener.class}) public class User { ... }
No, do I have to in order to get both custom JSF validation and hibernate validation simoultaneously? Removing the custom JSF validator, the hibernate validator works perfectly.
-
3. Re: Custom validators vs Hibernate validators
monkeyden Feb 10, 2011 10:44 AM (in response to mikael.brodd)I can't say for sure but I've used Validator pretty extensively on previous projects, always with that annotation, and never ran into that problem. I believe it pulls Validator into the JSF lifecycle. Verifying it is pretty simple. Have a go at it.
-
4. Re: Custom validators vs Hibernate validators
mikael.brodd Feb 11, 2011 8:12 AM (in response to mikael.brodd)Yep, that did the trick!
I'm not sure why, though. The documentation says that the JPAValidator validates the entity at insert or update. But I still get field validation and feedback in the xhtml. Strange.
But thank you anyhow :)regards - Mikael