| Why would you pass the second class? You only need the first one and it should work. The class parameter in createQuery() just defines the return type of the query. In Hibernate 6 the CriteriaBuilder API will get extensions for being able to make use of these Hibernate specific features there too. |