[appengine-java] Re: Struggling w/datastore relationship

2011-01-19 Thread WillSpecht
This is not the way that I would do it. First, this is the JAVA app engine group that code looks like python as is the link you referenced. The way I have found in app engine to be able to make the fastest queries is to use lists of keys in each object to manage relationships. so your model wo

[appengine-java] Re: Struggling w/datastore relationship

2011-01-19 Thread Benjamin Carlson
Thanks much for the link! It doesn't directly answer my issue, but it did give me a few more ideas about how to go about this... I've watched it three times (so far)! :) Despite seeing the merge-join in action, I don't think it quite matches my model, so I'm trying to visualize how to make my d

[appengine-java] Re: Struggling w/datastore relationship

2011-01-20 Thread WillSpecht
Just add a Tags list to User and a User list to Tag. This way you can search for Users with a given tag or Tags that has been used by a given user. Its still the same structure you just add another set of lists. If you do this, you will be able to quickly process each query you listed in your ori

[appengine-java] Re: Struggling w/datastore relationship

2011-01-20 Thread Benjamin Carlson
I just came across this document: http://www.scribd.com/doc/24330945/No-Relation-The-Mixed-Blessings-of-Non-Relational-Databases It helps, but doesn't completely answer my question. It would appear that what I'm wanting to do is an EAV (entities/attributes/values) type relationship, however, I'

[appengine-java] Re: Struggling w/datastore relationship

2011-01-20 Thread WillSpecht
So you want to be able to find all URL's saved by a User that have a certain Tag? Or, all the Users that have Tagged "Tech" to a URL? Or, all the Tags given a URL by a certain User? This can be done with our Model. It's actually what the second part of the video in the link is about. Merge Join

[appengine-java] Re: Struggling w/datastore relationship

2011-01-21 Thread WillSpecht
The first syntax should be: query.setFilter("urlId == urlParam"); query.setFilter("userId == userParam"); On Jan 21, 12:36 am, WillSpecht wrote: > So you want to be able to find all URL's saved by a User that have a > certain Tag? Or, all the Users that have Tagged "Tech" to a URL? Or, > all the

[appengine-java] Re: Struggling w/datastore relationship

2011-01-21 Thread WillSpecht
from http://code.google.com/appengine/docs/java/datastore/queries.html It looks like the syntax is Query q = new Query(TAG.class); q.addFilter("urlId == urlParam"); q.addFilter("userId == userParam"); On Jan 21, 4:13 pm, WillSpecht wrote: > The first syntax should be: > > query.setFilter("urlId