I have a spring boot 2.7.5 with hibernate 5.6.12 project and I wanted to upgrade to spring boot 3.1.0 with hibernate 6.6.2 I'm trying a query count in database for getting total number of records in database an I get the error org.hibernate.sql.ast.SqlTreeCreationException: Could not locate TableGroup - model.dao.User(1057834329991800) at org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.prepareReusablePath(BaseSqmToSqlAstConverter.java:3349) ~[hibernate-core-6.2.2.Final.jar:6.2.2.Final] Base class is:
and the class that extends it
in UserDaoImpl.list method, JPADaoImpl.getRowCount at line rowcount=entityManager.createQuery(countCriteria).getSingleResult(); I get the error org.hibernate.sql.ast.SqlTreeCreationException: Could not locate TableGroup - model.dao.User(1057834329991800) at org.hibernate.query.sqm.sql.BaseSqmToSqlAstConverter.prepareReusablePath(BaseSqmToSqlAstConverter.java:3349) ~[hibernate-core-6.2.2.Final.jar:6.2.2.Final] If I comment line countCriteria.where(fromRestriction); it works ok It works also in spring boot 2.7.5 with hibernate 5.6.12 Is it a bug in the new version of hibernate? Is it a workaround to fix this? Thank you, Adrian |