【问题标题】:Hibernate validator and spring versions compatibilityHibernate 验证器和 Spring 版本的兼容性
【发布时间】:2020-08-11 13:17:10
【问题描述】:

我们使用休眠验证器版本 5.2.5.Final 和 Spring 版本 5.0.15RELEASE 来验证输入数据以及 bean-io 框架。

现在我们计划将休眠验证器升级到最新版本 6.1.5,以提高工作流程的性能。

请提供最新的hibernate验证器兼容的spring框架版本。

【问题讨论】:

    标签: java spring hibernate hibernate-validator


    【解决方案1】:

    documentation下面的部分会给你一个提示。

    从 Spring 5.0 开始,此类需要 Bean Validation 1.1+,并特别支持 Hibernate Validator 5.x(请参阅setValidationMessageSource(org.springframework.context.MessageSource))。此类也与 Bean Validation 2.0 和 Hibernate Validator 6.0 运行时兼容,特别注意:如果您想调用 BV 2.0 的 getClockProvider() 方法,请获取本机 ValidatorFactory通过#unwrap(ValidatorFactory.class) 并在那里返回的本地引用上调用getClockProvider() 方法。

    【讨论】:

      猜你喜欢
      • 2013-08-03
      • 2020-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-27
      • 2013-06-06
      • 2013-07-20
      相关资源
      最近更新 更多