hello everyone,
I am searching for a way out to set NULL for the child upon deletion of the parent using hibernate annotations. Can some one please guide me on this? The annotation used presently in Table1.java is shown below and CascadeType.ALL doesn't even prevent the child from being deleted when the parent is deleted (as claimed in the page 10 of http://www.laliluna.de/download/ejb3-struts-tutorial-en.pdf).
@OneToMany(cascade={CascadeType.ALL}, fetch=FetchType.EAGER, mappedBy="table1", targetEntity=Table2.class) public Set getTable2s() { return this.table2s; }
<set name="table2s" cascade="none" lazy="true"> <key column="link2one" /> <one-to-many class=".Table2" /> </set>