Version increment on joined-subclass uses incorrect column names

Description

When forcing a version increment on an entity mapped with joined-subclass, the generated SQL will be incorrect if the subclass has a different ID column than the parent.

Test case:

Result:
java.sql.SQLSyntaxErrorException: ORA-00904: "PHONE_ID": invalid identifier

The full stack trace can be found in the attached file. Basically, hibernate tries to use the ID column for the subclass table when building the update statement (PHONE_ID in this case) but since the update is being performed on the root table, the column does not exist and the update fails.

This bug was previously reported as but was closed for not including a test case. We have been using the patch attached to that bug successfully in our application.

Environment

None

Assignee

Unassigned

Reporter

Spencer Van Hoose

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure