Hi, I'm working with App Engine(Java/JDO) and are trying to do some querying with lists.
So I have the following class:
@PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true")
public class MyEntity
{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
Key key;
@Persistent
List<String> tags = new ArrayList<String>();
@Persistent
String otherVar;
}
The following JDO-QL works for me:
( tags.contains('a') || tags.contains('b') || tags.contains('c') || tags.contains('d') ) && otherVar > 'a' && otherVar < 'z'
This seem to return all results where tags has one or more strings with one or more of the given values and together with the inequality search on otherVar
But the following do not work:
(tags.contains('a') || tags.contains('_a')) && (tags.contains('b') || tags.contains('_b')) && otherVar > 'a' && otherVar < 'z'
In this case I want all hits where there is at least one a (either a or _a) and one b (either b or _b) together with the inequality search as before.
But the problem is that I also get back the results where there is a but no b, which is not what I want.
Maybe I have missed something obvious, or done a coding error, or possibly there is a restriction on how you can write these queries in appengine, so any tips or help would be very welcome.
Regards Klas