mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-14 23:25:00 +00:00
HHH-7800: Fixed "maximize" doesn't work inside a disjunction issue
This commit is contained in:
parent
cd3363151b
commit
dadc43af23
@ -59,13 +59,15 @@ public void addToQuery(AuditConfiguration auditCfg, String entityName, QueryBuil
|
||||
|
||||
CriteriaTools.checkPropertyNotARelation(auditCfg, entityName, propertyName);
|
||||
|
||||
// Make sure our conditions are ANDed together even if the parent Parameters have a different connective
|
||||
Parameters subParams = parameters.addSubParameters(Parameters.AND);
|
||||
// This will be the aggregated query, containing all the specified conditions
|
||||
QueryBuilder subQb = qb.newSubQueryBuilder();
|
||||
|
||||
// Adding all specified conditions both to the main query, as well as to the
|
||||
// aggregated one.
|
||||
for (AuditCriterion versionsCriteria : criterions) {
|
||||
versionsCriteria.addToQuery(auditCfg, entityName, qb, parameters);
|
||||
versionsCriteria.addToQuery(auditCfg, entityName, qb, subParams);
|
||||
versionsCriteria.addToQuery(auditCfg, entityName, subQb, subQb.getRootParameters());
|
||||
}
|
||||
|
||||
@ -79,6 +81,6 @@ public void addToQuery(AuditConfiguration auditCfg, String entityName, QueryBuil
|
||||
}
|
||||
|
||||
// Adding the constrain on the result of the aggregated criteria
|
||||
parameters.addWhere(propertyName, "=", subQb);
|
||||
subParams.addWhere(propertyName, "=", subQb);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user