i also suggest always putting in mind that selects unlike inserts are more
problematic in datastore unlike sql. so youll want to save all the data you
may think you want in advance. remember datastore row model structure can be
altered as you go by adding more entities to the model.
i always save all the data ill need and also referencekey to stuff just for
keeping things in order.
-
Cheers,
public static function AlonCarmel() {
//Contact me
var email = 'a...@aloncarmel.me';
var twitter = '@aloncarmel';
var web = 'http://aloncarmel.me';
var phone = '+972-54-4860380';
}

* If you received an unsolicited email from by mistake that wasn't of your
matter please delete immediately. All E-mail sent from Alon Carmel is
copyrighted to Alon Carmel 2008. Any details revealed in e-mails sent by
Alon Carmel are owned by the Author only. Any attempt to duplicate or
imitate any of the Content is prohibited under copyright law 2008.



2010/6/14 Ian Lewis <ianmle...@gmail.com>

> Ben,
>
> With non-relational databases like appengine's datastore you need to
> create data based on the way you will query it rather than the way you
> want to store it.
>
> In your case it looks like you would need to create a model to store
> the data you want to query (essentially an index that you manage). A
> model something like the following might work.
>
> PeopleOwnItemsIndex {
>    person (reference to the person owning the items/people)
>    owner (reference to the person owning the item)
>    item (reference to the item owned)
> }
>
> You'll be querying on the person field so the query will need to go in
> your datastore-indexes.xml or index.yaml
>
> When you change owners or add items you'll need to update the data for
> this model. If you want to consolidate models you could also get only
> your own items by creating an index on person+owner and query it with
> person = me, owner = me. That would be instead of using PersonOwnItem,
> but the difference would be you would have a record for each person
> that can see the item rather than only one for the person owning the
> item.
>
> Ian
>
> On Sun, Jun 13, 2010 at 4:10 AM, Ben Woodhead <benwoodhead1...@gmail.com>
> wrote:
> > Hello Everybody,
> >
> > I am very comfortable with SQL and relational databases and I am
> > trying to wrap my head around GAE. Below is an example of how I would
> > tackle my problem in SQL and it would be really great if someone could
> > give me some hints on how to accomplish something similar in GAE. Its
> > basically a hierarchy of ownership.
> >
> > The 2 base tables:
> >
> > table People {
> >       int personId;
> >       string name;
> > }
> >
> > table items {
> >    int itemId;
> >    string itemName;
> > }
> >
> > The 2 relational tables:
> > table PeopleOwnPeople {
> >    int ownersId;
> >    int personId;
> > }
> >
> > table PeopleOwnItems {
> >    int personId;
> >    int itemId;
> > }
> >
> > So now that we have a basic structure I can start to explain the idea
> > or problem. I want to be able to search for all items owned by me and
> > the people i own:
> >
> > select items.* from Items, PeopleOwnPeople, PeopleOwnItems where
> > (PeopleOwnPeople.ownersId=234 and
> > PeopleOwnPeople.personId=PeopleownItems.personId) or
> > PeopleOwnItems.personId = 234 ;
> >
> > I am looking to use GWT as my frontend to this project so I am likely
> > going to be using Java for the backend but that isn't set in stone
> > yet.
> >
> > Thanks any and all help.
> > Ben
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> > To post to this group, send email to google-appeng...@googlegroups.com.
> > To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com<google-appengine%2bunsubscr...@googlegroups.com>
> .
> > For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
> >
> >
>
>
>
> --
> =======================================
> 株式会社ビープラウド  イアン・ルイス
> 〒150-0021
> 東京都渋谷区恵比寿西2-3-2 NSビル6階
> email: ianmle...@beproud.jp
> TEL:03-6416-9836
> FAX:03-6416-9837
> http://www.beproud.jp/
> =======================================
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com<google-appengine%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to