我有:
@ForeignCollectionField(eager = false)
private ForeignCollection<Field> fieldCollection;
我想从来自 Web 服务的数据中填充这个集合,因为我想将此数据插入到我的 Sqlite 数据库中。
我试着用这个:
boolean accessOnPremiseDb = false;
String description;
@ForeignCollectionField(eager = false)
private ForeignCollection<Entity> entitiyCollection =
new LazyForeignCollection<Entity, Integer>(null, accessOnPremiseDb,
accessOnPremiseDb, null, description, accessOnPremiseDb);
但我得到了错误
Caused by: java.lang.IllegalStateException: Internal DAO object is null.
Lazy collections cannot be used if they have been deserialized.
我怎样才能毫无问题地做到这一点?我应该为此创建新变量吗?