diff --git a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java index a68b8ad10f..8ab2110f51 100644 --- a/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java +++ b/hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java @@ -687,6 +687,15 @@ public abstract class AbstractEntityPersister final ArrayList propColumnReaderTemplates = new ArrayList<>(); final ArrayList joinedFetchesList = new ArrayList<>(); + if ( persistentClass.hasSubclasses() ) { + for ( Selectable selectable : persistentClass.getIdentifier().getSelectables() ) { + if ( !selectable.isFormula() ) { + // Identifier columns are always shared between subclasses + sharedColumnNames.add( ( (Column) selectable ).getQuotedName( dialect ) ); + } + } + } + for ( Property prop : persistentClass.getSubclassPropertyClosure() ) { names.add( prop.getName() ); types.add( prop.getType() );