7

I am using GreenDao ORM in my Android application.

As stated here , one can use

DaoSession.clear();

in order to clear ALL cached objects of the session.

My question is : How about clearing the cached objects of a specific entity (instead of all) ? How can I do that ?

Community
  • 1
  • 1
Leeeeeeelo
  • 4,333
  • 3
  • 34
  • 44

1 Answers1

2

There will be dao.detachAll() in the next release. The commit is here: https://github.com/greenrobot/greenDAO/commit/6a658c84e7de97073a260e062b06e3cc13a18196

Side note: use yourDao.detach(yourEntity) to remove a single entity from the identity scope. This forces subsequent queries for this database object to return a different object.

Markus Junginger
  • 6,950
  • 31
  • 52
  • Did you do that? The feature is still missing and I could not find an existing issue. I added a new one: https://github.com/greenrobot/greenDAO/issues/286 – Oliv Jan 20 '16 at 09:18