[appengine-java] Re: How to model this scenario

2009-08-19 Thread Sam Walker
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

[appengine-java] Re: How to model this scenario

2009-08-20 Thread Jason (Google)
Hi Sam. Are you saying that, given two node names, you want to see if there's an edge between them? In that case, couldn't you concatenate the two node names, putting the smallest one first, and doing a direct get to see if an entity is returned? If you get a result, that means there is an edge fro

[appengine-java] Re: How to model this scenario

2009-08-22 Thread Sam Walker
Hi Jason, I want to do a query like: Find all relationships in which A is involved. I think I cannot do anything like filter(A.key in key). So the only way is to do something like: filter(from = A.key & fromAttribute = false) + filter(to = A.key & toAttribute = false) (1st model in original post)

[appengine-java] Re: How to model this scenario

2009-08-25 Thread Jason (Google)
Hi Sam. It may be somewhat redundant, but if you include a list property with the two endpoints (in addition to the from and to properties), you can do a reasonably efficient query to find all edges connected to A. Or, if you know in advance which nodes you are interested in, you can keep track of