Profile Photo
This page is obsolete and is not maintained anymore. If you  cannot or don't want to rely on auto-configuration of Hibernate  Validator, for example in a JPA 1 environment and you are using Spring,  all one needs to do is this:          factory-method="buildDefaultValidatorFactory" />…
Profile Photo
This page is obsolete and is not maintained anymore.   As of Hibernate Validator 4.2.x we are offering a MessageInterpolator which is able to interpolate the validated value. The interpolator officially included in the distribution is ValueFormatterMessageInterpolator. You can interpolate the validated value by including ${validatedValue} into…
Profile Photo
This page is obsolete and is not maintained anymore. Here are all the pieces you need to write a ConstraintValidator which has access to the Hibernate Session respectively Hibernate EntityManager. This example will implement a @Unique constraint as discussed in HV-230. The reason @Unique is not part of the built-in constraints is the fact that…
Profile Photo
This page is out of date: content has moved there. A common use for a custom ConstraintValidatorFactory is the need to inject resources (eg the EntityManager or the Hibernate Session) into your custom ConstraintValidators. Here is what you have to do:   First you have to write your custom implementation of ConstraintValidatorFactory. This…
Profile Photo
<pre class="jive_text_macro jive_macro_alert" jivemacro="alert" ___default_attr="warning" _alert="warning"> <p><strong>This page is obsolete and is not maintained anymore.</p> </pre>   This is are the pieces needed to do message interpolation in a web application based on the client Locale. This is just a suggestion, there are other solutions.…
Profile Photo
This page is obsolete and is not maintained anymore. Frameworks integrating with Bean Validation Here  is a list of frameworks integrating with Bean Validation. Presentation layer JSF 2 integrates natively and validates data from forms according to the constraints of the  property the value will be populated in. Wicket has a framework providing…
Profile Photo
This page is obsolete and is not maintained anymore. Here are some links to usage examples of Hibernate Validator / Bean Validation:   Method Validation with Hibernate Validator 4.2 Presentation on Bean Validation: Best practices for real life What's new in Hibernate Validator 4.1 Getting started with JSR 303 Bean Validation with JPA 1.0…