We have a query:
List<Book> books = session.createQuery(
"from Book b where :x member of b.bookCategories")
.setParameter("x", crimeStory)
.list();
But when executing this query, we got a warning message:
WARN 10:19:41 deprecation: HHH90000016: Found use of deprecated 'collection property' syntax in HQL/JPQL query [null.elements]; use collection function syntax instead [elements(null)].
I tried to change the query to:
List<Book> books = session.createQuery(
"from Book b where ? in elements(b.bookCategories)")
.setParameter(0, crimeStory).list();
but the warning message was still there.
Please help me to fix this warning.
P/s: We are currently using Hibernate 5.0.2