-->
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.  [ 2 posts ] 
Author Message
 Post subject: Modelling question
PostPosted: Sat Nov 25, 2006 10:55 am 
Newbie

Joined: Sat Nov 25, 2006 10:49 am
Posts: 1
Hi,

I am currently working on my first ORM project and would like
to ask you for advice of how to model the following problem:

poll_id, question_id, user_id, answer

In standard sdl I would define a primary key over pollid up to user_id
and create the table as above.
Whats the best way to model this in Hibernate?

Thanks a lot,

Michael


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 27, 2006 11:08 am 
Regular
Regular

Joined: Tue Feb 24, 2004 11:42 am
Posts: 56
<composite-id
name="id"
class="myclass">

<key-property name="pollid" type="Long" column="poll_id"/>
<key-many-to-one name="question class="Question" column="question_id"/>
<key-many-to-one name="user class="User" column="user_id"/>
</composite-id>


Hope this helps

Please do rate


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