I want to create a key for this relationship, lets say if A -> B exists, B
-> A cannot exist together. I was thinking of concatenating key A and key B,
sth like A-B. I make sure the smallest key is first, so that I dont have any
B-As.

But, how would I do a query for the two entitites? Is the only solution to
have extra ArrayList<Key> or Key from, Key to attributes and put them in the
criteria?


On Mon, Aug 10, 2009 at 5:08 AM, objectuser <[email protected]> wrote:

>
> If that's as complex as your queries get, I'd recommend just doing to
> queries and merging the results.
>
> Also, if the semantics of fromAttribute and toAttribute are different,
> then you've lost that in your second model.
>
> On Aug 9, 10:45 pm, Sam Walker <[email protected]> wrote:
> > I have a directed graph scenario and I want to model the relationship
> with
> > App Engine data store.
> >
> > Relationship {
> >   Key from;
> >   Key to;
> >   boolean fromAttribute;
> >   boolean toAttribute;
> >
> > }
> >
> > I want to do this query: where (from = <key> and fromAttribute =
> > <attribute>) or (to = <key> and toAttribute = <attribute>). Ors are not
> > allowed. So, I am not sure how to do it. I am now thinking of doing:
> >
> > Relationship {
> >   ArrayList<Key> both; // Will always have two keys
> >   ArrayList<boolean> attributes;
> >
> > }
> >
> > Now, I could change the query to: where <key> in both, and then check for
> > respective attributes, but that's kinda ugly.
> >
> > I am sure there will be a better way, please help.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" 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-java?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to