-->
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.  [ 3 posts ] 
Author Message
 Post subject: one-to-many for elements with composite identifiers
PostPosted: Sun Oct 26, 2003 10:51 pm 
Beginner
Beginner

Joined: Mon Sep 22, 2003 7:16 am
Posts: 25
I have an element:
Code:
<class name="Enroll" table="enroll">
  <composite-id>
    <key-many-to-one name="student" column="student_id" class="Student"/>
    <key-many-to-one name="module" column="module_code" class="Module"/>
  </composite-id>
  <property name="enrollDate" column="enroll_date" type="date"/>
</class>


I'll like to attach a set of "Result" to the Enroll class which has student_id, and module_code as foreign key. I tried using <key><column>... but didnt work. Like:
Code:
<set name="results" lazy="true" inverse="false" table="result">
  <key>
    <column name="student" column="r_student_id"/>
    <column name="module" column="r_module_code"/>
  </key>
  <one-to-many class="Result"/>
</set>

How could I define the <set>?

[/code]


Top
 Profile  
 
 Post subject: Re: one-to-many for elements with composite identifiers
PostPosted: Mon Oct 27, 2003 11:44 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Code:
    <column name="student" column="r_student_id"/>
    <column name="module" column="r_module_code"/>


column is a column so it has no column attribute.
Code:
    <column name="r_student_id"/>
    <column name="r_module_code"/>

_________________
Emmanuel


Top
 Profile  
 
 Post subject: oops
PostPosted: Mon Oct 27, 2003 9:08 pm 
Beginner
Beginner

Joined: Mon Sep 22, 2003 7:16 am
Posts: 25
my silly fault
thx a lot


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