如何利用吗?
我不敢肯定,这是否是吗.的丑恶,或者如果说是错的话。
1. 说有本领域模式
@Entity("person")
public class Person {
private String property1;
private String property2;
private HashMap<String, Thing> things;
}
i) 如果试图通过扩大基本食品食品食品券的班子来挽救这一错误:(如上所述,UsedView相当于Thing)
java.lang.IllegalArgumentException: can t serialize class com.model.designed.UsedView at org.bson.BSONEncoder._putObjectField(BSONEncoder.java:205) at org.bson.BSONEncoder.putMap(BSONEncoder.java:245) at org.bson.BSONEncoder._putObjectField(BSONEncoder.java:177) at org.bson.BSONEncoder.putObject(BSONEncoder.java:121) at org.bson.BSONEncoder.putObject(BSONEncoder.java:67) at com.mongodb.OutMessage.putObject(OutMessage.java:189) at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:245) at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:209) at com.mongodb.DBCollection.insert(DBCollection.java:66) at com.mongodb.DBCollection.save(DBCollection.java:622) at com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:731) at com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:793) at com.google.code.morphia.DatastoreImpl.save(DatastoreImpl.java:787) at com.google.code.morphia.dao.BasicDAO.save(BasicDAO.java:109)...
然后,一经修改:
"private HashMap<String, Thing> things"
纽约总部
"private HashMap<String, String> things"
它可免予罚款。
任何想法?
非常感谢!