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?
|