Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding deleting and deleting relations in greenDao

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?

like image 949
prom85 Avatar asked Mar 25 '13 08:03

prom85


1 Answers

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.

like image 141
Markus Junginger Avatar answered Oct 18 '22 19:10

Markus Junginger