I\'m using ORMLite, trying to use the ForeignCollectionKey but I got the following error :
Internal DAO object is null. LazyCollections cannot be use
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
.