Skip to content

Commit 78e5f3e

Browse files
committed
HHH-18583 Include identifier cols in persister's shared column names
1 parent 357f32c commit 78e5f3e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,15 @@ public AbstractEntityPersister(
747747
final ArrayList<Boolean> definedBySubclass = new ArrayList<>();
748748
final ArrayList<Boolean> propNullables = new ArrayList<>();
749749

750+
if ( persistentClass.hasSubclasses() ) {
751+
for ( Selectable selectable : persistentClass.getIdentifier().getSelectables() ) {
752+
if ( !selectable.isFormula() ) {
753+
// Identifier columns are always shared between subclasses
754+
sharedColumnNames.add( ( (Column) selectable ).getQuotedName( dialect ) );
755+
}
756+
}
757+
}
758+
750759
for ( Property prop : persistentClass.getSubclassPropertyClosure() ) {
751760
names.add( prop.getName() );
752761
types.add( prop.getType() );

0 commit comments

Comments
 (0)