Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Data + Hibernate 5 (Spring Boot 1.4) - getting Deprecation Messages

I recently migrated from Spring Boot 1.3.6 to 1.4.0. Now I get several warnings of the same kind in my logfile:

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)].

The warnings are caused by my spring-data repositories. Some methods are using userdefined queries like

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

and others have queries derived by methode names like

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

The question/answer How to remove Hibernate deprecation warning message shows how to prevent the message for userdefined queries. But it also states that its valid JPQL. What is the recommended way handle this warning?

like image 763
bfeater Avatar asked Dec 08 '25 06:12

bfeater


1 Answers

It is a bug in Hibernate which has been fixed in 5.1.5 and 5.2.7.

You will need to update to Spring Boot 2.x. Even Spring Boot 1.5.14 still has Hibernate 5.0.12. However, Spring Boot 2.0.3 has Hibernate 5.2.17.

like image 163
Wim Deblauwe Avatar answered Dec 09 '25 18:12

Wim Deblauwe