Reputation: 5561
I'm using app engine (Java) datastore API to build a project. I'm not using JDO/JPA but low level API.
How can I set multiple values for an entity property? I can find documentation about how to do so when using JDO or JPA (using Lists) but can't find that info for low level API.
Thanks.
Upvotes: 4
Views: 2234
Reputation: 31
You can pass a Collection as the value for a property in Entity.setProperty().
If value is a Collection, the values will be stored in the datastore with the collection's iteration order with one caveat: all indexed values will come before all unindexed values (this can occur if the Collection contains both values that are normally indexed like strings, and values that are never indexed like Blob, Text and EmbeddedEntity).
See the setProperty javadoc here.
Upvotes: 2