-
Type: Bug
-
Status: Resolved
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 10.10-HF34
-
Fix Version/s: 10.10-HF42, 11.5, 2021.2
-
Component/s: Query & PageProvider
When using a QueryBuilder to query logs and using the same reference in two different predicates, the same variable name is used both times and therefore cannot be replaced with two different values.
For example, the following QueryBuilder:
QueryBuilder queryBuilder = new QueryBuilder(); queryBuilder.and(new Predicate(new Reference("eventDate"), Operator.GTEQ, new DateLiteral(start))); queryBuilder.and(new Predicate(new Reference("eventDate"), Operator.LTEQ, new DateLiteral(end)));
results in the following native query:
FROM LogEntry log WHERE log.eventDate >= :eventDate AND log.eventDate <= :eventDate ORDER BY log.eventDate DESC
The :eventDate variable is then replaced twice by the same value and the query does not return the expected result.
- Is referenced in
(2 Is referenced in)