Although I've seen several similar topics posted, the best-practice solution still isn't clear to me.
My use-case:
I'm using a JDBC helper library to persist some large objects whose class definitions were generated by Hibernate Tools from an existing database.
What I'd like to do:
At the application-level, I'd like to use Hibernate Validator to validate the objects using the validation constraints generated by Hibernate Tools.
Problem:
Hibernate Tools seems to only generate @Column annotations for the class properties, which don't appear to be recognized by Hibernate Validator as validation constraints.
Questions:
1. Should I create my own custom Hibernate Validator constraint handler for the @Column annotation?
2. Is there a way to get Hibernate Tools to generate Hibernate Validator-style constraints?
3. Am I totally missing something?
Thank you.
- Jim
|