Yash Agarwal
Yash Agarwal

Reputation: 1035

Storing entity as property of another entity in GAE (Google App Engine)?

static void editItem(Entity item,Entity user)
    {
        item.setProperty("Owner",user); 
    }

Is doing the above thing of setting one entities property as another entity not a bad thing or I should just store the key like this -

item.setProperty("Owner",user.getKey());

Upvotes: 1

Views: 1154

Answers (1)

Jernej Jerin
Jernej Jerin

Reputation: 3389

According to Google AppEngine docs:

Properties of an embedded entity are not indexed and cannot be used in queries. You can optionally associate a key with an embedded entity, but (unlike a full-fledged entity) the key is not required and, even if present, cannot be used to retrieve the entity.

You can find more here in Embedded Entities.

Upvotes: 1

Related Questions