The types of paths in comparison expressions are now checked for compatibility as per https://hibernate.atlassian.net/browse/HHH-15802 , so your queries are failing on purpose. What Hibernate 5 did in the past was not safe. See some discussions about this here https://github.com/hibernate/hibernate-orm/pull/5800 and the migration guide entry: https://github.com/hibernate/hibernate-orm/blob/6.2/migration-guide.adoc#query-path-comparison |