read and change behave differently with the same SQLQuery
Hi,
I'm using Gigaspaces 12.2.1.
I am storing space document made up of a property called id
that is set as the spaceId (autogenerated == true) and various other properties that are of type String. Some indexed and some not.
The problem I am encountering is that if I create the following SQLQuery:
SQLQuery<MyDocument> sq = new SQLQuery<>("MyDocument","`id` IN (?) AND `prop1` IN (?) AND `prop2` IN (?)");
sq.setParameter(1, Lists.newArrayList("myId"));
sq.setParameter(2, Lists.newArrayList("value1"));
sq.setParameter(3, Lists.newArrayList("value6", "value7"));
and then populate the space with a MyDocument object which only matches id
but not the other two properties, the read and change behavior are different.
I get zero entries when issuing a read call with the above SQLQuery object which is expected. But if I issue a change call with the same SQLQuery object the result is one changed entry which is not expected.
If I remove the id IN (?)
from the query, change and read work as expected.
It seems like including the id
property in the query causes other the properties to be ignored. I have also tried using id = ?
with the appropriate setParameter and the other two IN clauses but the behavior does not change.
Am I missing something here? Is the query I'm trying to write valid? Any thoughts?
Thanks!
Hanns