zhangjingl02 / activejdbc

Automatically exported from code.google.com/p/activejdbc
0 stars 0 forks source link

deleteCasade() does not delete children of children and does not really cascade beyond one level down #112

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create a parent-child-subchild relationship
2. delete(true) or deleteCascade() the parent
3. children are deleted, subchildren are not

What is the expected output? What do you see instead?

I would expect a deleteCascade would cascade deletion by traversing the entire 
association graph. It might be nice to provide an option to allow deletion of 
entities in this way when needed.

Original issue reported on code.google.com by jweissma...@gmail.com on 26 Aug 2011 at 9:06

GoogleCodeExporter commented 9 years ago
Perhaps we could specify with annotations? Something like @OnDelete(cascade = 
Cascade.ALL) or @OnDelete(cascade = Cascade.CHILDREN) etc. Just a thought :)

Original comment by jweissma...@gmail.com on 2 Sep 2011 at 2:20

GoogleCodeExporter commented 9 years ago
annotations are defined during declaration, but we need to make a choice in 
client code. Having two independent methods makes more sense

Original comment by ipolevoy@gmail.com on 2 Sep 2011 at 6:59

GoogleCodeExporter commented 9 years ago

Original comment by ipolevoy@gmail.com on 4 Sep 2011 at 8:09

GoogleCodeExporter commented 9 years ago
see this: 
http://igorpolevoy.blogspot.com/2011/09/activejdbc-cascades-deep-and-shallow.htm
l

Original comment by ipolevoy@gmail.com on 13 Sep 2011 at 5:40