HHH-7800: Fixed "between" doesn't work inside a disjunction issue

This commit is contained in:
Csaba Varga 2012-11-21 12:12:17 +01:00 committed by Lukasz Antoniak
parent 54760bb61e
commit ff25434d1f
1 changed files with 4 additions and 2 deletions

View File

@ -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);
}
}