We're updating the issue view to help you get more done. 

HQL left join fetch not working in inheritance scenario: org.hibernate.QueryException: could not resolve property

Description

I have the following entity configuration:

Entity.java

1 2 3 4 5 6 7 8 9 10 11 12 @Entity @Inheritance(strategy = InheritanceType.JOINED) public class BaseEntity { @Id private long id; } @Entity public class EntityA extends BaseEntity { @OneToMany(fetch = FetchType.LAZY) private Set<EntityC> attributes; }

The query

1 from BaseEntity entity left join fetch entity.attributes

throws this exception:

1 org.hibernate.QueryException: could not resolve property: attributes of: BaseEntity

This used to work. I am not expert on HQL specification, so not sure whether this is a bug or intended feature.

Environment

Hibernate - 5.2.15
JVM - 1.8.0_161-b12
Postgresql 9.6.8
Linux 3.13.0-143-generic

Status

Assignee

Christian Beikov

Reporter

Ondra David

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.2.13

Components

Affects versions

5.2.17
5.3.1
5.2.15
5.3.0.Final
5.2.16

Priority

Major