I use GreenDAO. But, throws this exception:
"de.greenrobot.dao.DaoException: Entity is detached from DAO context".
In the generated code, i find this code.
/** called by internal mechanisms, do not call yourself. */
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;
myDao = daoSession != null ? daoSession.getPeerGroupDao() : null;
}
Anyone know when the GreenDAO call it? Also, how to trigger it to call.
Thanks.
I find solution.
The greenDAO call __setDaoSession internally when you call loadDeep and queryDeep. After calling these method, the one to many or one to one relation is built up. If you just use SQLiteDatabase to query your result, you just get your data but the relationship is not built up.
In detail, you can go this site
Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With