I have this @Query annotation @Query("SELECT new DTOs.EntityDTOs.cropvariety.CropVarietyPropagationDetailsDTO(s.cropVariety.id, cast(s.propagationMethod as Enums.PropagationMethod), s.daysUntilHarvestLongestEstimate, s.minimumTemperature, s.sowDepth) FROM CropVarietyPropagationDetails s WHERE s.cropVariety.id IN :idList") If i don’t explicitly cast s.propagationMethod as Enums.PropagationMethod the following error is thrown when calling the constructor CropVarietyPropagationDetailsDTO : java.lang.IllegalStateException: Could not determine appropriate instantiation strategy - no matching constructor found and one or more arguments did not define alias for bean-injection This is because s.propagationMethod is stored as an ordinal enum value in the database. However in Hibernate 5 this caused no issues. It would automatically convert the ordinal value to the corresponding Enum type value before injecting it into CropVarietyPropagationDetailsDTO. So i assume the current behavior can be considered a bug. Since hibernate 6 i also can’t use the ordinal value in a @Query jpql query statement anymore. The following no longer works: @Query("UPDATE User u SET u.userStatus = 0 WHERE u.userStatus = 1") Instead i have to define it like this: @Query("UPDATE User u SET u.userStatus = Enums.UserStatus.OFFLINE WHERE u.userStatus = Enums.UserStatus.ONLINE") |