8

First question is, when does greenDao generate a delete function for a entity? And what's the difference between calling the entity.delete() and the session.getEntityDao.delete(entity)?

Second, if I delete a parent entity with a child that has ToOne relation to the parent, I have to remove the child by myself, don't I? Actually no automatic dependency "cleaning" is done, is that right?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
prom85
  • 16,896
  • 17
  • 122
  • 242

1 Answers1

16

entity.delete() requires an entity to be "active", dao.delete(entity) works for all entities.

There are no cascading deletes in greenDAO, you got to delete entities individually.

Ria
  • 10,237
  • 3
  • 33
  • 60
Markus Junginger
  • 6,950
  • 31
  • 52