HHH-16967 Missing join on inheritance parent table to validate @Where condition
This commit is contained in:
parent
166f6e685b
commit
ed743a590d
|
@ -6718,4 +6718,8 @@ public abstract class AbstractEntityPersister
|
|||
public String getDiscriminatorAlias() {
|
||||
return DISCRIMINATOR_ALIAS;
|
||||
}
|
||||
|
||||
protected String getSqlWhereStringTableExpression(){
|
||||
return sqlWhereStringTableExpression;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1366,6 +1366,13 @@ public class JoinedSubclassEntityPersister extends AbstractEntityPersister {
|
|||
if ( mainTableReference != null ) {
|
||||
retainedTableReferences.add( mainTableReference );
|
||||
}
|
||||
final String sqlWhereStringTableExpression = persister.getSqlWhereStringTableExpression();
|
||||
if ( sqlWhereStringTableExpression != null ) {
|
||||
final TableReference tableReference = tableGroup.getTableReference( sqlWhereStringTableExpression );
|
||||
if ( tableReference != null ) {
|
||||
retainedTableReferences.add( tableReference );
|
||||
}
|
||||
}
|
||||
if ( needsDiscriminator() ) {
|
||||
// We allow multiple joined subclasses to use the same table if they define a discriminator column.
|
||||
// In this case, we might need to add a discriminator condition to make sure we filter the correct subtype,
|
||||
|
|
Loading…
Reference in New Issue