Can't use TYPE function on leaf subtype of a table per class inheritance hierarchy

Description

It's not possible to use the TYPE function on a leaf type of a table per class hierarchy. Let's consider the following model

When querying SELECT TYPE(f) FROM Father f it will produce invalid SQL, something like

The AbstractEntityPersister#getDiscriminatorColumnReaderTemplate for a leaf subtype should return the type index as constant instead of the invalid column reference.

Environment

None

Status

Assignee

Christian Beikov

Reporter

Christian Beikov

Fix versions

Labels

None

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Minor
Configure