Omit joining of superclass table when querying subclass only

Description

When you have an inheritance hierarchy with "joined" inheritance type and query something from a subclass, superclass is always joined in the query even though it is not needed. Example:

JPQL query:

Translated SQL query:

Super class table join is useless in the SQL query. It could be optimized.

I discussed that on Hibernate forum

Environment

None

Status

Assignee

Ladislav Kulhánek

Reporter

Ladislav Kulhánek

Fix versions

Labels

None

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.3.7

Priority

Major
Configure