google-code-export / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
1 stars 0 forks source link

Support storing Map<Enum,String> #124

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It would be great if Objectify supporting a Map with an Enum as the key. 

for:

enum MyEnum {
   FOO, BAR
}
@Embed
Map<MyEnum,String> myMap = new HashMap<MyEnum,String>() {
    put(MyEnum.FOO,"foo");
    put(MyEnum.BAR,"bar");
};

It would be stored as:

myMap.FOO |  myMap.BAR
foo                  bar

Or something to that effect.

Original issue reported on code.google.com by R...@broadcastr.com on 15 May 2012 at 9:34

GoogleCodeExporter commented 9 years ago
I think that the specific implementation of enum map ([EnumMap 
http://docs.oracle.com/javase/1.5.0/docs/api/java/util/EnumMap.html]) should be 
supported instead of generic map implementation with enum as key.
Support EnumMap should be easier.

Original comment by fabio.gr...@gmail.com on 8 May 2013 at 8:36

GoogleCodeExporter commented 9 years ago
This works now with Ofy5 using Map and a @Stringify annotation. However, it 
would be more convenient to automatically recognize enums. Also support EnumMap.

Original comment by lhori...@gmail.com on 14 Apr 2014 at 12:36

GoogleCodeExporter commented 9 years ago
Issue 112 has been merged into this issue.

Original comment by lhori...@gmail.com on 14 Apr 2014 at 12:37

GoogleCodeExporter commented 9 years ago

Original comment by lhori...@gmail.com on 14 Apr 2014 at 2:42