MongoDB:使用Morphia保存DBObject时出错

时间:2016-04-22 20:53:03

标签: java mongodb morphia

使用: 蒙戈-Java的应用程序,3.2.2.jar 和 吗啡-1.1.1.jar

代码: for (UserList userList: userLists){ DBObject userListDbObj = SingletonLaunchDB.getMorphia().toDBObject(userList); SingletonLaunchDB.getMongo().save(userListDbObj); }

错误追踪:

Grave: java.lang.RuntimeException: Generic TypeVariable not supported! at org.mongodb.morphia.mapping.MappedField.toClass(MappedField.java:616) at org.mongodb.morphia.mapping.EphemeralMappedField.getSubClass(EphemeralMappedField.java:84) at org.mongodb.morphia.mapping.EphemeralMappedField.<init>(EphemeralMappedField.java:39) at org.mongodb.morphia.mapping.MappedField.discoverType(MappedField.java:498) at org.mongodb.morphia.mapping.MappedField.discover(MappedField.java:465) at org.mongodb.morphia.mapping.MappedField.<init>(MappedField.java:93) at org.mongodb.morphia.mapping.MappedClass.discover(MappedClass.java:540) at org.mongodb.morphia.mapping.MappedClass.<init>(MappedClass.java:124) at org.mongodb.morphia.mapping.Mapper.getMappedClass(Mapper.java:431) at org.mongodb.morphia.DatastoreImpl.getWriteConcern(DatastoreImpl.java:1632) at org.mongodb.morphia.DatastoreImpl.save(DatastoreImpl.java:686)

UserList是一个未注明@Entity并且没有@Id字段的类,原因是什么?

0 个答案:

没有答案