From ac95b64aad766c57972d4a2b6019575270766cfa Mon Sep 17 00:00:00 2001 From: Csaba Varga Date: Wed, 21 Nov 2012 12:12:17 +0100 Subject: [PATCH] HHH-7800: Fixed "between" doesn't work inside a disjunction issue --- .../envers/query/criteria/BetweenAuditExpression.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/query/criteria/BetweenAuditExpression.java b/hibernate-envers/src/main/java/org/hibernate/envers/query/criteria/BetweenAuditExpression.java index bec0a534be..c2b289f71d 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/query/criteria/BetweenAuditExpression.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/query/criteria/BetweenAuditExpression.java @@ -44,7 +44,9 @@ public class BetweenAuditExpression implements AuditCriterion { public void addToQuery(AuditConfiguration auditCfg, String entityName, QueryBuilder qb, Parameters parameters) { String propertyName = propertyNameGetter.get(auditCfg); CriteriaTools.checkPropertyNotARelation(auditCfg, entityName, propertyName); - parameters.addWhereWithParam(propertyName, ">=", lo); - parameters.addWhereWithParam(propertyName, "<=", hi); + + Parameters subParams = parameters.addSubParameters(Parameters.AND); + subParams.addWhereWithParam(propertyName, ">=", lo); + subParams.addWhereWithParam(propertyName, "<=", hi); } }