Hibernate Validator 4.0.0 Alpha3 发布 - 开源中国社区
Float_left Icon_close
Hibernate Validator 4.0.0 Alpha3 发布
红薯 2009年03月21日

Hibernate Validator 4.0.0 Alpha3 发布

红薯 红薯 发布于2009年03月21日 收藏 0 评论 0

阿里云高性能云服务器,2折起! >>> >>>  

Hibernate Validator version 4.0.0 Alpha3 is of now available. This implementation is based on JSR 303 Specification 1.0.CR1[1]. The distribution packages contain everything you need to get started.

As promised in the last post implicit grouping is now available. On top of this the metadata API is now in sync with the current spec and there is a JPA 2 aware TraversableResolver. @Valid supports now Iterables and the cascading algorithm follows the new graph navigation rules. In the previous releases an object instance would only be validated once per group. Now this instance can be validated once per group AND validation path. Lets look at the object graph below to illustrate the change:

Assuming a @NotNull constraint on Address.addressLine validating the shown Order instance against the default group will now result in three ConstraintViolations differing only in the property path. The paths are:

  • shippingAddress.addressline1
  • customer.addresses[0].addressline1
  • billingAddress.inhabitant.addresses[0].addressline1

Previously only one ConstraintViolation would have returned and it was not defined which property path it would contain. Last but not least the ConstraintValidator resolution algorithm got revamped and works now with generics. This allows support for constructs like:

Collection<? extends Number> element;

For further information about this release refer to the Jira change log and please provide us with some feedback.

转载请注明:文章转载自 开源中国社区 [http://www.oschina.net]
本文标题:Hibernate Validator 4.0.0 Alpha3 发布