-->
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.  [ 3 posts ] 
Author Message
 Post subject: Help for an unanswered question
PostPosted: Tue May 16, 2006 3:16 pm 
Beginner
Beginner

Joined: Sun Dec 21, 2003 11:19 pm
Posts: 22
Location: Kentucky, USA
Can anyone help me solve the issue on initialization of an association in an open session in message http://forum.hibernate.org/viewtopic.php?t=959101?

Any help, including ideas on how to approach debugging the problem myself, would be greatly appreciated.

Timothy Vogel


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 16, 2006 7:21 pm 
Regular
Regular

Joined: Fri Oct 01, 2004 2:19 am
Posts: 111
Location: Melbourne, Australia
Tim,

There's a lot of traffic on this forum regarding what constitutes a good
hashCode/equals implementations with Hibernate. Run a search and you'll
find a lot of good advice. Basically, I think your problem boils down to
your hashCode/equals methods using persistent identifiers.
You are following the surrogate key idiom, which implies that these values (ids)
have no business meaning, and so you should not use them in your
hashCode/equals methods.

Also, note that the hashCode/equals are used for uniquely identifying
objects within a set/map etc, but in your case you're actually comparing
Courses using the included assignments - can't courses be identified
using some other properties?

_________________
Cheers,

Bonny

please don't forget to rate :)


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 21, 2006 3:58 pm 
Beginner
Beginner

Joined: Sun Dec 21, 2003 11:19 pm
Posts: 22
Location: Kentucky, USA
Bonny,
Thanks for the pointers. I'm not sure I understand everything I read but believe that I understand enough for correct code.
Timothy Vogel


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

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.