-->
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: Composite Key and Generated Code
PostPosted: Mon Oct 10, 2005 2:24 am 
Regular
Regular

Joined: Thu Feb 17, 2005 1:58 am
Posts: 63
Hibernate 3.x and Tools 3.x alpha 5

Table: Group, PK=groupId (an int)
Table: Member, PK=memberId (an int)
Table: GroupMember, Pk=groupId, memberId

Class Generated:

GroupMember with GroupMemberId get/setId().

Also generated:

GroupMember.setGroup(...);
GroupMember.setMember(...);

Per the XML mapping file, GroupMemberId is mapped correctly.

However, even if one was to use GroupMember.setGroup(g) and GroupMember.setMember(m), GroupMember.groupMemberId field would still not have been initialized with the groupId and memberId from g and c resp.

Would have been nice if setGroup(g) would update the groupId field of the GroupMemberId class. That would have been more intuitive.

Comments?


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.