-
1. Re: seam-gen entities: cascading bug or accepted behavior?
maxandersen Nov 15, 2007 1:39 AM (in response to sstrenn)it's a default behavior - there isn't implemented suport for taking into account db specific constraints.
Open a feature request against hibernate tools ;)
p.s. you can use reveng.xml to control parts of this. -
2. Re: seam-gen entities: cascading bug or accepted behavior?
sstrenn Nov 15, 2007 2:13 AM (in response to sstrenn)Max,
Thanks for clearing that up. I'll submit a feature request to the hibernate tools project to adjust the cascade attribute so that it matches the database-defined behavior. I'll also submit a request to the seam team for a mention of this behavior in the "Getting started with Seam, using seam-gen" section of the reference.
BTW - just as an example of what can happen if one does not change the "default behavior":
Delete a (sales) employee. This cascades to delete all of the customers associated with that employee, which, in turn, cascades to delete all of the sales orders and line items associated with that customer. Also, if the employee table has a self-referential foreign key to identify the employee's boss, a whole chain of other employees (and their customers and sales orders) can be deleted...
Stephen -
3. Re: seam-gen entities: cascading bug or accepted behavior?
sstrenn Nov 15, 2007 3:41 AM (in response to sstrenn)I have submitted the feature request to the hibernate tools team.
I have also added an entry on the Seam Problems FAQ: http://wiki.jboss.org/wiki/Wiki.jsp?page=SeamProblemsFAQ