I am new to google datastore. Looking at mapping between entities (Java)

44 views
Skip to first unread message

tonycavanagh1929

unread,
Apr 4, 2019, 1:15:42 PM4/4/19
to Google App Engine
Working through the examples, if I have say an entity person that has an entity address. I could create a EmbeddedEntity and add that to a Entity as a one to one mapping, I could even create a list make it a one to many.

is that the only way, if I want separate storage, for say an object, with a one to many mapping to another, would I first have to pull that first object back, which will contain a list of keys, I then use those keys to bring back the many objects.

Or is there a way of pulling an object, and it will pull all the other objects mapped to it. (Not using EmbeddedEntity).

Thank you for any help.

Regards Tony.


George (Cloud Platform Support)

unread,
Apr 9, 2019, 12:16:51 PM4/9/19
to Google App Engine
Hello Tony, 

You seem to think along the lines of SQL databases. Cloud Datastore is a highly-scalable NoSQL database for your applications. Entities in a Datastore mode database form a hierarchically structured space similar to the directory structure of a file system. When you create an entity, you can optionally designate another entity as its parent; the new entity is a child of the parent entity (note that unlike in a file system, the parent entity need not actually exist). An entity without a parent is a root entity. 

Your desired functionality may be realized by way if indexes
Reply all
Reply to author
Forward
0 new messages