Presuming you want the map values stored as a series of properties
with a Long value (for example, stuff.put("abc", 123) would produce a
property "stuff.abc" with value 123L), I suggest you use Objectify4
(grab from trunk) and leave off the @Embedded annotation. It will
work as you expect.
Jeff
Assuming you're talking Objectify4... yes, that will work. When Ofy4
sees a Map<String, Anything> it works exactly as if the map is an
embedded class with expando-type fields. Take for example these two
entity classes:
@Entity public class Thing {
@Embed public static class Inner {
Long foo;
Long bar;
}
Inner content;
}
@Entity public class Thing {
Map<String, Long> content;
}
If you put "foo" and "bar" in the Map of the 2nd entity, they read and
write the exact same datastore entity. In fact, they are
plug-replaceable... you can read and write the same data int the
datastore.
This works whether the Map value is a Long, String, Set<String>,
@Embed class, Key<?>, whole @Entity (in which case it stores a Key
mapping), etc. As long as the Map key is a String, objectify treats
it like an embedded class.
How did you store your Map<String, Set<String>>? Does the entity
property look like:
foo.key1 = ["abc", "def"]
foo.key2 = ["ghi", "jkl"]
If so you can switch to a POJO with a Map<String, Set<String>> field
named 'foo'.
Jeff