-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: cannot access loading collection - Best Practice
PostPosted: Fri Dec 03, 2004 9:55 pm 
Newbie

Joined: Fri Dec 03, 2004 9:44 pm
Posts: 6
Location: Eugene, OR
I had the "cannot access loading collection" exception thrown by my code. After digging around, I found the explaination. However, I was unable to find any best practice solutions. In my case, I have a parent/child relationship that tries to manipulate the parent collection during the setParent() method on the child.

I found the two following solutions:

The solution suggested by my Hibernate in Action book: put a addXXX method in the parent class. The addXXX method manipulates the child to make sure the parent is set properly.

A solution suggested on the forum: Use the access="field" attribute on the many-to-one property of the child.

Both of these solutions seem to work, but I'm not really sure which would be considered the best practice. Does anybody have any suggestions?

The reason I'm asking is because neither seems ideal.

Richard Hensley


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.