As we already know, criterion query is deprecated in Hibernate 5. It was such a useful feature in the previous versions of Hibernate. And it still performs better than HQL.
So what is the reason of it's deprecation in Hibernate 5 ?
And also this question is not a duplicate of this question as I want to know the reason of the deprecation of criteria query.
This is from here.
Hibernate offers an older, legacy
org.hibernate.Criteria
API which should be considered deprecated. No feature development will target those APIs. Eventually, Hibernate-specific criteria features will be ported as extensions to the JPAjavax.persistence.criteria.CriteriaQuery
. For details on theorg.hibernate.Criteria
API, see Legacy Hibernate Criteria Queries.