java - "HashMap is not a supported property type" - embedding a map with Objectify 4 -


i'm trying embed map in entity objectify 4 (and gae sdk 1.9.0).

the docs (here) show stuff this:

@embed class leveltwo {     string bar; }  @entity class entitywithembeddedcollection {     @id long id;     list<levelone> ones = new arraylist<levelone>(); } 

so first tried same thing hashmap< long, leveltwo >. resulted in runtime error when tried save entity.

then read @embedmap, recent addition ofy. tried following formlation:

class leveltwo {     integer one;     boolean bee; }  class entitywithembeddedcollection {     @id long id;     @embeddedmap     map<long, leveltwo> ones = new hashmap<long, leveltwo>(); } 

i tried leveltwo inner static class , few other variations, get:

com.googlecode.objectify.saveexception: error saving com.myapp.userinfosvr@96: items: java.util.hashmap not supported property type.     @ com.googlecode.objectify.impl.transmog.save(transmog.java:105) 

any suggestions?

@embedmap works string keys, , works creating property on entity looks "foo.bar.yourkeyhere". it's not sophisticated mechanism.

what trying do? may wish consider mapify annotation , embedded collection.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -