Sunday, November 08, 2009

Gachi - Query interface added

GAE/j has a built-in Query concept which I have extended into a Gachi Query interface through which all queries must be executed.

At my very first test on the newly implemented interface I ran into a well known "feature" of GAE/j, the "can't operate on multiple entity groups in a single transaction" problem. This exception is thrown when you try to operate in more than one entity-group within a single transaction (as the text describes pretty well :-) ), but I simply just queried for all Wishlists (my example), which are all entity-roots, and then I did a DatastoreService.get(key) using the key returned from the query. "WTF!" I thought - "Can't I query multiple entity-roots? Then how will I list all Wishlists?".. This is infact quite tricky, but I've added a "keysOnly" switch to my Query interface, which will, if set, only work within a single entity-root, but if unset, you may Query mutiple entity-roots, but only see properties (as of now)..

Next up - lazy load of ManyAssociation items (currently they are all instanciated when first accessed)

3 Comments:

Anonymous Anonymous said...

This comment has been removed by a blog administrator.

28/12/09 00:52  
Anonymous Anonymous said...

This comment has been removed by a blog administrator.

1/1/10 12:22  
Anonymous Anonymous said...

This comment has been removed by a blog administrator.

11/1/10 05:07  

Post a Comment

<< Home