ORMLite : Internal DAO object is null

后端 未结 2 343
不知归路
不知归路 2021-01-14 03:15

I\'m using ORMLite, trying to use the ForeignCollectionKey but I got the following error :

Internal DAO object is null. LazyCollections cannot be use

2条回答
  •  悲哀的现实
    2021-01-14 03:56

    Do you have any ideas ? Is my model construction right ? Thanks

    So the exception message is trying to explain what is going on. I'm not sure how it can be improved.

    Internal DAO object is null. LazyCollections cannot be used if they have been deserialized.

    You are trying to access zoneChild which is a ForeignCollection that has been deserialized. Since it has been deserialized all of the underlying database configurations and connections could not be reestablished. I guess this can happen when it stored in an Android Bundle? I'm not sure if this is the only case.

    If you need to get the Zone children you are going to have to either call dao.refresh() on the entity after you deserialize it or do the query yourself by doing the zoneDao.

提交回复
热议问题