Reputation: 53
I have the database c2d_selfpickup
in the Anylogic model:
I have to find the c2d_lm value by SCid
and PVZid
using QueryDSL:
List <Double> c2dlmList = selectFrom(c2d_selfpickup)
.where(c2d_selfpickup.sc_id.goe(SCid)
.and( c2d_selfpickup.pvz_id.goe(PVZid) ))
.list(c2d_selfpickup.c2d_lm);
If I choose the next pair:
int SCid = 256151;
int PVZid = 547307;
I expect that the query returns c2dlmList
with one value 8.0
(the row number 8), but it returns 7 values:
[2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0]
What I do wrong?
Thanks a lot.
Upvotes: 0
Views: 68
Reputation: 141
The result is actually correct. The query considers all entries in the database, so it will return all rows where sc_id >= 256,151
and pvz_id >= 547,307
(goe = greater or equal).
In case you only want to get the row that exactly matches both conditions, you may want to use eq()
instead of goe()
.
Upvotes: 1