aspose file tools*
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 Spring in Action this week in the Spring 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: 125
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using Hibernate Validator with XML declaration and Spring configuration in a Maven project