HHH-18583 Include identifier cols in persister's shared column names

This commit is contained in:
Marco Belladelli 2024-09-10 08:57:35 +02:00
parent 42cf3b59f6
commit 37abf552c7
No known key found for this signature in database
GPG Key ID: DBD6E257ABE9EA3D
1 changed files with 9 additions and 0 deletions

View File

@ -687,6 +687,15 @@ public abstract class AbstractEntityPersister
final ArrayList<String[]> propColumnReaderTemplates = new ArrayList<>();
final ArrayList<FetchMode> 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() );