HHH-18503 Register root table name usage for persisters with physical discriminators
This commit is contained in:
parent
aae1ef9df0
commit
49cca414b9
|
@ -3022,10 +3022,20 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
|
|||
parentType.getRootEntityDescriptor().getEntityName()
|
||||
);
|
||||
}
|
||||
final EntityDiscriminatorMapping discriminator = parentType.getDiscriminatorMapping();
|
||||
final String entityName;
|
||||
if ( discriminator != null && discriminator.hasPhysicalColumn() && !parentType.getSubMappingTypes().isEmpty() ) {
|
||||
// This is needed to preserve optimization for joined + discriminator inheritance
|
||||
// see JoinedSubclassEntityPersister#getIdentifierMappingForJoin
|
||||
entityName = parentType.getRootEntityDescriptor().getEntityName();
|
||||
}
|
||||
else {
|
||||
entityName = parentType.getEntityName();
|
||||
}
|
||||
registerEntityNameUsage(
|
||||
tableGroup,
|
||||
EntityNameUse.EXPRESSION,
|
||||
parentType.getEntityName()
|
||||
entityName
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue