Hi.
I am trying "two inequality filters" with tricky way as below,
because I want to search for entities which have "start" and "end"
property
by condition that If some value is between "start" and "end".
The code is as follows
("A" means "start", "B" means "end")
DatastoreService datastore =
DatastoreServiceFactory.getDatastoreService();
Key fooKey = KeyFactory.createKey("Foo", "1");
Entity entity = new Entity(fooKey);
entity.setProperty("x", Arrays.asList(new String[] { "A:10", "Z:
25"}));
datastore.put(entity);
fooKey = KeyFactory.createKey("Foo", "2");
entity = new Entity(fooKey);
entity.setProperty("x", Arrays.asList(new String[] { "A:20", "Z:
35"}));
datastore.put(entity);
fooKey = KeyFactory.createKey("Foo", "3");
entity = new Entity(fooKey);
entity.setProperty("x", Arrays.asList(new String[] { "A:30", "Z:
40"}));
datastore.put(entity);
String target = "22";
Query query = new Query("Foo");
query.addFilter("x", Query.FilterOperator.LESS_THAN, "A:" + target);
query.addFilter("x", Query.FilterOperator.GREATER_THAN_OR_EQUAL, "Z:"
+ target);
query.addSort("x", Query.SortDirection.ASCENDING);
for (Entity taskEntity : datastore.prepare(query).asIterable()) {
resp.getWriter().println(taskEntity);
}
I want to get Foo/1, Foo/2 as result.
And this code works as expected on sdk1.3.0,
but does not work(no result) on sdk1.3.1.
My code or sdk, which is wrong?
(or any advise?)
Thanks in advance.
Kenji Ishii
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.