This week's book giveaways are in the Refactoring and Agile forums. We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line! See this thread and this one for details.
Using Hibernate Validator with XML declaration and Spring configuration in a Maven project
posted 5 years ago
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?