HHH-12565 Fix that returns the discriminator constant instead of column reference for leaf subtypes

This commit is contained in:
Christian Beikov 2018-05-11 21:02:42 +02:00 committed by Steve Ebersole
parent f972dd4d29
commit f62cecc62b
1 changed files with 5 additions and 1 deletions

View File

@ -338,8 +338,12 @@ public abstract class AbstractEntityPersister
}
public String getDiscriminatorColumnReaderTemplate() {
if ( getEntityMetamodel().getSubclassEntityNames().size() == 1 ) {
return getDiscriminatorSQLValue();
} else {
return Template.TEMPLATE + "." + DISCRIMINATOR_ALIAS;
}
}
protected String getDiscriminatorAlias() {
return DISCRIMINATOR_ALIAS;