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(child);
> 
> omitting the first line could cause bugs in more complicated circumstances.

So exactly what could happen if we use a bidirectional relationship without
setting one way read-only and set both sides of the relationship explicitly?
I believe I'm just doing that and *never* experienced any problems. Beside
that, I feel it quite an overhead doing all this manually, so I'd like to
know about both the drawbacks, the dangers, and why that's all unavoidable
doing so, or why it cannot happen automatically in the background..

thanks for the explanation in advance,

dyn
-- 
.Digital.Yearning.for.Networked.Assassination.and.Xenocide


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to