Bean Validation's public draft has now been approved by the EC (all members voting yes except Nortel and SpringSource who did not vote).
But we have not stopped there!
Reference implementation
We are pleased to release the first alpha of the Bean Validation Reference Implementation: Hibernate Validator 4 Alpha (download).
This is a big milestone and the core features are already present and the implementation is already used in the JSF 2.0 RI prototype. This release is not feature complete though, here are the main missing parts:
- Group inheritance using interfaces or implicit grouping
- Group sequence is implemented but not fully tested
- Overriding the Default group of a class is not implemented yet
- TraversableResolver does not integrates with JPA yet
- XML configuration (META-INF/validation.xml)
- XML mapping
- some metadata APIs are not fully compliant
- ConstraintValidatorContext is not operational
The distribution includes source code, jars and a getting started guide.
Everything should work as described in the spec otherwise. For help, come to our forum. Please file bugs to JIRA. For more informations on Hibernate Validator 4, see here. Many thanks to Hardy for leading the effort and to Alaa and Gunnar for stepping up.
Specification
This implementation is based on the specification 1.0 Beta3[1] (post public draft). This version improves:
- the bootstrap API names are much more intuitive
- type-safe validator implementations: a constraint is attached to several validators, the right one being chosen based on the targeted type
- XML configuration via META-INF/valiation.xml
- XML constraint mapping (allowing annotation overriding)
Give us feedback and tell us how it goes.
A couple of hours ago I downloaded the Alpha version and I was eager to see new features specially for the localized messages but what I see is the same old hibernate validator with javax annotations.
since this validation usually is used to notify the user who is entered invalid data, the proper message is very important. I hope there was a feature somehow to return back the message contains the human readable field name. For example instead of telling the user "The value must not be null" we could say "the salary rate must not be null". currently we can define a key message for each field but I wish it was a simple way for example a mapping message bundle which is contains the full class name and its field:
com.foo.app.Person.salaryRate=salary rate
and hibernate were able to automatically load the value from bundle, so corresponding message in the resourse bundle for @NotNull could be something like:
the %FIELD_NAME% must not be null
Thanks again for standardizing the validator
We Are Developing An Web Application With Spring And Hibernate Combination.
I am Facing Some Problems In Edit Functionality .When I Am Updatig My Record
It Is Calliing The Validation Before Updating The Record But Even There Are
Some Error Before coming To Page With Validation Messages It Is Updating The
Record.I Think It Is Because Of Hibernate Flush-Mode =Auto .Somebody can Help Me In The
Matter
hi,
I am developing one application where I have to validate a form using Bean-constrants.xml and validate.xml but not using annotation.Can anybody help me in this regard.I also want to know configuration details of these xml files.
regards,
Sanjeev.