[appengine-java] Re: How to make a query using low level API using the 'key' property?

2009-09-11 Thread Max Ross
Your use of key filters and sorts sounds appropriate. On Wed, Sep 9, 2009 at 12:22 AM, Corneliu Paul Lupulet corneliu.lupu...@gmail.com wrote: Hello, Thank you for you answers. I would like to make a clarification, why i am using the key property in a query. Using an order by key, I am

[appengine-java] Re: How to make a query using low level API using the 'key' property?

2009-09-08 Thread Jason (Google)
A key is a complex object -- you can't query on it using a simple string literal. Also, you shouldn't be changing an entity's key after it's persisted -- once a key is set, that key is associated with the entity for its lifetime. If you want to query by key, you should use the __key__ syntax and

[appengine-java] Re: How to make a query using low level API using the 'key' property?

2009-09-04 Thread Corneliu Paul Lupulet
I noticed that i can make a query like this: DatastoreService ds = DatastoreServiceFactory.getDatastoreService(); Query query = new Query(DbContact); query.addFilter(__key__, FilterOperator.GREATER_THAN, KeyFactory.stringToKey(a_key_string)); And it works. It fetches the correct results. Then i