-->
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.  [ 6 posts ] 
Author Message
 Post subject: SortedMap and Lazy Initialization
PostPosted: Fri Jan 30, 2004 8:21 am 
Newbie

Joined: Tue Jan 27, 2004 7:20 pm
Posts: 3
Hello,

I have a problem in an unidirectional one-to-many association. A "Process" have a SortedMap of "Marker" indexed by an entity called "Period". The Period class implements Comparable and is orderd by it


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 1:58 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
something wrong with your comparable implem ?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 4:14 pm 
Newbie

Joined: Tue Jan 27, 2004 7:20 pm
Posts: 3
No... there


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 5:47 pm 
Beginner
Beginner

Joined: Tue Nov 11, 2003 4:49 am
Posts: 47
Location: Florence, Italy
I see that Period is an entity key for your mapping, to me happened something similar when I mismatched equals and hashCode on the key class.
Are they ok ?
Ciao.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 31, 2004 11:46 am 
Newbie

Joined: Tue Jan 27, 2004 7:20 pm
Posts: 3
I


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 3:09 am 
Beginner
Beginner

Joined: Tue Nov 11, 2003 4:49 am
Posts: 47
Location: Florence, Italy
Only some remarks:
1) I don't know what EqualsBuilder and HashCodeBuilder do, but I can notice that here for two Period A and B
Code:
A.compareTo(B) != A.equals(B)

cause equals is done on ID and compareTo on dates.
2) This equals/hashCode couple seems wrong to me, cause you put all Period with same begin/end but different Id on the same Map bucket.
Hope this can help.
Ciao.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.