【问题标题】:Spring Data + Hibernate 5 (Spring Boot 1.4) - getting Deprecation MessagesSpring Data + Hibernate 5 (Spring Boot 1.4) - 获取弃用消息
【发布时间】:2016-12-31 18:47:33
【问题描述】:

我最近从 Spring Boot 1.3.6 迁移到 1.4.0。现在我在我的日志文件中收到了几个相同类型的警告:

org.hibernate.orm.deprecation: HHH90000016: Found use of deprecated 'collection property' syntax in HQL/JPQL query [null.elements]; use collection function syntax instead [elements(null)].

这些警告是由我的 spring-data 存储库引起的。有些方法使用用户定义的查询,例如

@Query("select ... where ... member of ...")

其他人的查询由方法名称派生,例如

List<...> findBy...Contains(...);

问题/答案How to remove Hibernate deprecation warning message 显示了如何阻止用户定义查询的消息。但它也声明其有效的 JPQL。 处理此警告的推荐方法是什么?

【问题讨论】:

    标签: hibernate spring-boot spring-data


    【解决方案1】:

    这是一个bug in Hibernate,已在 5.1.5 和 5.2.7 中修复。

    您需要更新到 Spring Boot 2.x。即使Spring Boot 1.5.14 仍然有 Hibernate 5.0.12。但是,Spring Boot 2.0.3 具有 Hibernate 5.2.17。

    【讨论】:

      猜你喜欢
      • 2017-12-23
      • 1970-01-01
      • 2016-12-23
      • 2020-09-25
      • 1970-01-01
      • 2019-10-07
      • 1970-01-01
      • 2019-01-25
      • 2018-03-16
      相关资源
      最近更新 更多