Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What you are doing is representing property as a separate entity. So you'll end up with several different entities representing properties (=attributes) that reference the parent entity.</p> <p>This is not feasible for the following reasons:</p> <ol> <li><p>You will not be able to query entity over several properties. </p></li> <li><p>If you want to atomically change an entity or it's properties (add/delete entity, add/delete/change properties) you'll have to put all of them in an entity group and use transactions.</p></li> <li><p>You will need to use queries to find properties of an entity, which is costly. </p></li> <li><p>When you delete an entity, you will need to manually find all property entities and delete those.</p></li> </ol> <p>So, all-in-all I can not recommend this approach.</p> <p>Solution:</p> <p>GAE Datastore is a schemaless database, meaning that you can store entities of the same kind with different properties, e.g. have dynamic properties. The problem arises how to map dynamic properties to classes.</p> <p>In python you can achieve this via the <a href="http://code.google.com/appengine/docs/python/datastore/expandoclass.html" rel="nofollow">Expando class</a>.</p> <p>In Java, you can use the <a href="http://code.google.com/appengine/docs/java/datastore/entities.html" rel="nofollow">low-level Entity class</a>. The low-level API is the most powerful as it exposes all Datastore features, but is pain to use as you work with "type-less" Entity class, instead of your model classes.</p> <p><a href="http://code.google.com/p/objectify-appengine/" rel="nofollow">Objectify</a> used to have embedded maps, where you add properties to this map and they end up as properties in entity. They found an error in the implementation in Objectify 3.1 and retracted this feature (= gone from docs). This feature <a href="http://code.google.com/appengine/docs/java/datastore/entities.html" rel="nofollow">will be back in Objectify 4</a>, which is not yet released, but you can build it from trunk if you feel brave.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload