-->
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: Mapping Issue
PostPosted: Mon Nov 10, 2008 6:16 pm 
Newbie

Joined: Mon Nov 03, 2008 8:00 am
Posts: 2
Hi everyone,

I am pretty new to hibernate so I got stuck on this issue. I have the following 2 tables (the schemas have come from existing databases and cannot be changed):

Qualification
qual_id --- Pri Key
employee_id
type_id
qualification
description

Qualification_Type
qual_type_id --- Pri Key
qual_type

Qualification is the main table and links to Qualification_Type table via type_id. I want to map these tables to a singal class:

Qualification
qual_id
type
qualification
description

I have got the mapping for everything from the Qualification table working fine but i cannot get the join to work. I have tried the following but i cant get the property ref to work correctly and it seems to always use the qual_id not the type_id:

Code:
<join table="Qualification_type">
          <key column="qual_type_id" property-ref="type_id"/>
          <property name="type" column="qual_type"/>
</join>


Am I using the correct method? or am i going down the wrong path?

Thank you in advance,

Ed


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.