this query does not return any objects even there are lot of objects to return for the second operand:
select a from Action a where (a.state = 2 or a.state = 3) and a.type = 0 and a.transferred = 0
if the query is changed to
select a from Action a where (a.state = 3 or a.state = 2) and a.type = 0 and a.transferred = 0
there are all the results for the condition a.state = 3
it seems that the or is not working at all
the query plan is:
Query plan 1/2 description
============================
[Step 1]
Scan index com.agile.hummingbird.Action[state, subType, type, startDate, endDate, detail, transferred]
locating Action (a) instances that satisfy:
and(and(or((a.state=3),(a.state=2)),(a.type=0)),(a.transferred=0)).
[Step 2]
Apply selection and prepare final results.
<btreePlan 15.7575 4,74/6,50 a(Action) index(-161:sstsedt[and(and(or([3->3:notNull],(a.state=2)),[pos<2>0->0:notNull]),[pos<6>0->0:notNull])]) />