I'm using app eng开发者_JS百科ine (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.
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.
精彩评论