I use Hibernate 5.4.32.Final, when I try to execute this query via spring data:
@Query("select new some.package.dto.TwoFieldDto(o.gln, u.email) "
+ "from OrganizationEntity o "
+ "join UserEntity u on u.organization.id = o.id "
+ "where o.gln in (:glnList)")
List<TwoFieldDto<String, String>> findEmailListByGlnIn(List<String> glnList);
On starting application Hibernate throw SyntexException when it reaches to UserEntity token, and gives out unexpected token.
If I try to execute query from the UserEntity side, query compiles successfully. (Yes, I haven't get a link from OrganizationEntity to UserEntity)
Is this Hibernate version not supported JOIN ON syntex? (OrganizationEntity doesn't contain link on UserEntity, but UserEntity has it).