Morphia Generics - Not Possible?
I'm trying to save a List of Generics(M) through Mongo/Morphia. I get this error when I tried to save:
开发者_开发知识库com.google.code.morphia.mapping.MappingException: Generic Typed Class not supported: = class java.lang.Object
Does this mean that Morphia doesn't support Generics at all? Is there an alternative that would work? Using generics saves me 16 classes. There has to be an easier way that is allowed.
Surprisingly I haven't been able to find anything useful on this error.
The error says everything:
com.google.code.morphia.mapping.MappingException: Generic Typed Class not supported: = class java.lang.Object
Morphia does not support save generics in the DB, so, you can try to make a simple interface and then make all classes you want to save implement it, or something like that.
hope it helps;
精彩评论