On Sun, Dec 01, 2002 at 10:44:33AM +1100, Gavin King wrote:
> P.S. I'm not keen on the way you add items to bidirectional association. The
> correct idiom is:
>
> parent.getChildren().add(child); //yes, even if the children collection is
> readonly="true"
> child.setParent(parent);
> sess.save(chi
It can be a problem in "transient state":
Parent p = new Parent();
Child c = new Child();
c.setParent(p);
assertTrue("parent must have a child", p.getChildren() != 0 );
there are two possible solutions :
1) implement "void setParent(Parent p){ this.p = p;
p.getChildren().add(this); }
I made a number of small changes to get my example
working on HSQL with cascading deletes, then when
I switched back to MySQL cascading deletes worked
there as well!
So yes, cascading deletes work on MySQL.
I'd like my example to be using Hybernate in the
best way possible (under the constraints o
> P.S. I'm not keen on the way you add items to bidirectional association.
The
> correct idiom is:
>
> parent.getChildren().add(child); file://yes, even if the children
collection is
> readonly="true"
> child.setParent(parent);
> sess.save(child);
>
> omitting the first line could cause bugs in mor
Looking over the source, I'm wondering about a comment in HibeAggregatorDAO
// if cascade worked, we could just do this
//removeObject(feed);
this is followed by:
ses.delete( "select newsfeed.subscriptions.elements "
+"from newsfeed in class ag.Newsfeed" )
which