红联Linux门户
Linux帮助

Hibernate Validator 5.4.0.Final发布,Bean验证框架

发布时间:2017-02-03 16:02:10来源:红联作者:roeta
Hibernate Validator 5.4.0.Final 发布了。

用 Annotations 给类或者类的属性加上约束(constraint),在运行期检查属性值是很优雅的。Hibernate Validator 就是这样一个验证框架,不需要和 Hibernate 的其他部分绑定就可以使用,只要在你的项目中添加 Hibernate-annotations.jar 库就可以了。

该版本在 5.4.0.CR1 版本上有几个小的修复,并增加了一个小的新功能:现在可以要求 @ScriptAssert 违规约束报告在特定的属性。 在以下示例中,违规约束将在 endDate 属性上报告,而不是在类级别上报告:[code]@ScriptAssert(lang = "javascript", script = "_this.endDate.after(_this.startDate)", reportOn="endDate")public class CalendarEvent {
private Date startDate; private Date endDate; //...}[/code]软件详情:http://in.relation.to/2017/02/02/hibernate-validator-540-final-out/

下载地址:http://sourceforge.net/projects/hibernate/files/hibernate-validator/5.4.0.Final/hibernate-validator-5.4.0.Final-dist.tar.gz/download

来自:开源中国社区
文章评论

共有 0 条评论