HHH-16435 - Fix for issue (combine filterpredicates with potential already existing ones)

Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
Jan Schatteman 2023-04-06 00:47:43 +02:00 committed by Jan Schatteman
parent 7f6b054a14
commit 4eef64f81e
2 changed files with 3 additions and 3 deletions

View File

@ -821,7 +821,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
addVersionedAssignment( assignments::add, sqmStatement );
FilterHelper.applyBaseRestrictions(
(filterPredicate) -> additionalRestrictions = filterPredicate,
(filterPredicate) -> additionalRestrictions = combinePredicates( additionalRestrictions, filterPredicate),
entityDescriptor,
rootTableGroup,
AbstractSqlAstTranslator.rendersTableReferenceAlias( Clause.UPDATE ),
@ -1078,7 +1078,7 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
}
FilterHelper.applyBaseRestrictions(
(filterPredicate) -> additionalRestrictions = filterPredicate,
(filterPredicate) -> additionalRestrictions = combinePredicates( additionalRestrictions, filterPredicate),
entityDescriptor,
rootTableGroup,
AbstractSqlAstTranslator.rendersTableReferenceAlias( Clause.DELETE ),

View File

@ -87,7 +87,7 @@ public class SingleTableInheritanceFilterTest {
@Entity(name = "AbstractSuperClass")
@DiscriminatorColumn(name = "DISC_COL", discriminatorType = DiscriminatorType.INTEGER)
@FilterDef(name = "dummy_filter", defaultCondition = "(ID IS NOT NULL)")
@FilterDef(name = "dummy_filter", defaultCondition = "(id IS NOT NULL)")
@Filter(name = "dummy_filter")
public static abstract class AbstractSuperClass {
@Id