-->
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.  [ 5 posts ] 
Author Message
 Post subject: .:: Identifier of an instance changing exception???
PostPosted: Thu Mar 04, 2004 8:46 am 
Beginner
Beginner

Joined: Tue Jan 27, 2004 8:25 am
Posts: 45
Hi all,
I


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 04, 2004 8:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Why do you use a composite id class for HotelRoomWithChildrenDisscount if you don't have any other properties beside?

Anyways, you have to implement equals/hashCode for your composite id. And do it properly (refer to the equalsHashCode page in the wiki)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 04, 2004 8:58 am 
Beginner
Beginner

Joined: Tue Jan 27, 2004 8:25 am
Posts: 45
michael wrote:
Why do you use a composite id class for HotelRoomWithChildrenDisscount if you don't have any other properties beside?

Anyways, you have to implement equals/hashCode for your composite id. And do it properly (refer to the equalsHashCode page in the wiki)


So I there is no need in using another class for the ID, isn


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 04, 2004 9:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You could do that, but using a own class has other advantages when doing cascades, etc. So I'd say stick to the class but look at equals/hashCode


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 04, 2004 10:01 am 
Beginner
Beginner

Joined: Tue Jan 27, 2004 8:25 am
Posts: 45
michael wrote:
You could do that, but using a own class has other advantages when doing cascades, etc. So I'd say stick to the class but look at equals/hashCode


Thank you very much!!!


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