This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Using Hibernate Validator with XML declaration and Spring configuration in a Maven project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Using Hibernate Validator with XML declaration and Spring configuration in a Maven project" Watch "Using Hibernate Validator with XML declaration and Spring configuration in a Maven project" New topic
Author

Using Hibernate Validator with XML declaration and Spring configuration in a Maven project

Kjeld Sigtermans
Ranch Hand

Joined: Aug 10, 2006
Posts: 122
Hi,

Is it possible to use Hibernate Validator for validating Hibernate domain objects, having the validation parameters be specified declaratively in XML instead of using annotations, and perhaps using Spring to initialize/configure Hibernate Validator?
I generate the Hibernate mappings and domain classes, so I do not want to add annotations to them.
I already know Hibernate Validator 4 supports XML declaration of validation parameters, but it seems this is still in Beta phase? Anyway I could not find the correct maven dependencies for a stable version.
I also found a way to configure Hibernate Validator in Spring by adding a validation event listener bean to the applicationcontext.xml. However, that particular class could not be found so again, I need the correct dependencies.

If the above is possible, can somebody help me get started with the correct dependencies, and Java code or Spring configuration to initialize/execute validation?

Cheers,
Kjeld



Kjeld Sigtermans - SCJP 1.4 - SCWCD 1.4
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Using Hibernate Validator with XML declaration and Spring configuration in a Maven project
 
Similar Threads
I need a small project to do with spring and hibernate.
NoClassDefFoundError
Spring + Struts 2 Validator
Why Spring?
Validator for Java Beans