0

After creating an entity:

DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Entity employee = new Entity("Employee");

How to set an index-able list property? like say:

employee.setProperty("tag", "manager", "corrupted", ...);
//  "tag" is the property name, 
//  "manager", "corrupted".. are the values in the list.
Testuser
  • 1,717
  • 2
  • 16
  • 24
Tom Fishman
  • 1,716
  • 6
  • 22
  • 36

1 Answers1

1

Looking at the javadoc, you can give a Collection as the second param to setProperty.

E.g

List<String> tags = new ArrayList<String>();
tags.add("manager");
tags.add("corrupted");

employee.setProperty("tag", tags);
Gary
  • 926
  • 3
  • 12
  • 24