]
Adrian Nistor updated ISPN-3442:
--------------------------------
Fix Version/s: 6.0.0.Beta1
Affects Version/s: 6.0.0.Alpha2
Query API DSL returns bad result on calling negated between() with
includeUpper/Lower(false)
--------------------------------------------------------------------------------------------
Key: ISPN-3442
URL:
https://issues.jboss.org/browse/ISPN-3442
Project: Infinispan
Issue Type: Bug
Components: Querying
Affects Versions: 6.0.0.Alpha2
Reporter: Jiří Holuša
Assignee: Jiří Holuša
Fix For: 6.0.0.Beta1
Assuming existing of three users with IDs 1,2 and 3.
Then this code's result is incorrect.
{code:border=solid}
Query q = queryFactory.from(User.class)
.not().having("id").between(1, 2).includeLower(false)
.toBuilder().build();
{code}
It returns no user whereas it should return two users with IDs 1 and 3. I debugged the
org.infinispan.query.dsl.impl.JPAQueryGeneratorVisitor and found the problem in
visit(BetweenOperator operator).
The code correctly changes the </<= and >/>= operators if between operator is
negated, but forgets to change "AND" to "OR".
Thus the generated string query ends up like "id <= 1 AND id > 2" which
is of course always empty result.
The pull request contains fix to this bug and also extended tests for Query API DSL to
increase code coverage.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: