Hibernate-core 6.4.2, SpringBoot 3.2.10. I upgraded my Spring from 3.0.7 and Hibernate from 6.1.7. I am seeing this error. Not Sure if criteria api is compatible with these versions. Help.
The error is pretty clear. You can’t compare an expression with the type Hotel
with an expression of the type Integer
. You probably have some code like criteriaBuilder.equal( root.get( "hotel" ), id )
which is simply invalid. Use the primary foreign key criteriaBuilder.equal( root.get( "hotel" ).get( "id" ), id )
.