-->
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: How to map this??? - Composite Primary Key...
PostPosted: Tue Dec 28, 2004 7:06 am 
Newbie

Joined: Sun Nov 21, 2004 6:20 pm
Posts: 11
Hi,
i have my problems with mapping the following....How would you map this in the hmb.xml - files??

The EntityRelationshipModel of the DB is:

Table Question: question_id Primary Key
text

Table Options: option_id Primary Key
question_id Primary Key, Foreign Key referencing Question
option_text

My Problem is, that the primary key of table Options consists of two colums....I know, there is the composite-id - Tag, where I can wrap the question_id and the option_id in an own class....but how can I relate this to the table Question and above all, how would I overwrite equals() and hashCode() in these Classes...??.

I would be very thankful, if anybody could provide me the mapping files for the problem above, cause I have read the docs up and down..but I cannot really find a solution for this...it would be a great help for me..

THANK YOU!


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.