Hi jago,

On Nov 20, 5:34 am, jago <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Each GalleryObject can be a 'root' without any parent or it has a
> parent, which is another GalleryObject it is based on.
>
> This means each GalleryObject may have a history of parents,
> grandparents, etc.
>
> How should I store this history? Store only the immediate parent or a
> list of those parents? Which is more efficient when I want to get a
> list of parents from the datastore. I think only storing the immediate
> parent will result in problems, no?

The way you choose to represent the ancestry chain doesn't make that
much difference, but if you want to query on these relationships,
different representations can better facilitate different types of
queries.

The following documentation may be helpful in making a design
decision:
http://code.google.com/appengine/docs/datastore/queriesandindexes.html#Queries_on_Keys
http://code.google.com/appengine/docs/datastore/queryclass.html#Query_ancestor
http://code.google.com/appengine/docs/datastore/modelclass.html#Model_get_by_id

It seems like storing a list of parents would require less searching
through the datastore, but if these relationships change often it
could make updating all of the lists when writing more painful.

>
> Also how do I store this list of parents? By reference or using their
> index? (Each GalleryObject has an index (0,1,2,3, ...)
>
> So storing a list of GalleryObjects means either storing (0, 12, 55,
> 3234, ...) or (ref1key, ref2key, ref3key, ...)
>
> Which way would you suggest? I guess storing by using their index
> makes the most sense, no? Otherwise if I delete a GalleryObject it
> might be referenced by key somewhere else (what happens if I do this?
> won't it be deleted since a reference still points to it?)

An entity will be deleted even if there are references pointing to it.
ReferenceProperties can point to entities which no longer exist.

>
> thanks...jago

Happy coding,

Jeff
--~--~---------~--~----~------------~-------~--~----~
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-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to