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

Hibernate Validator 4.0.0 Alpha3 发布

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

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:

@MyConstraint
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 发布
分享
评论(0)
最新评论
顶部