With the update from hibernate 5.6 to 6.2 some of our update and delete queries cause invalid SQL to be generated. In all cases there’s an alias used in the where clause which isn’t declared. This occurs in cases the query contains a condition which refers to a relation of the entity to update/delete. The JPQL query
is translated to SQL as
We were able to create a reproducer with 3 entities. In our production code, this also occurs in cases with only 2 entites which do not require any join or inner select. We could not reproduce this case in a simple code base. A reproducer can be found at https://github.com/steffen-schaefer/hibernate-alias |