-->
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: Help with composite keys
PostPosted: Fri Jan 20, 2006 11:02 am 
Regular
Regular

Joined: Tue Jan 03, 2006 11:43 am
Posts: 51
Location: Sweden
I'm new to NHibernate and I'm having problem mapping a legacy database with composite keys.

The database looks like this (I've removed all unneccesary info):

Kpi
------
(PK) kpiId : int



KpiColumn
------------
(PK) kpiId : int
(PK) position : int
with foreign key to Kpi


KpiData
----------
(PK) kpiId : int
(PK) position : int
(PK) counter : int
with foreign key to KpiColumn (kpiId and position)

PK means Public Key above.
Here are the classes:

Code:
class Kpi {
int id;
IList kpiColumns;
}

class KpiColumn {
IList kpiData;
}

class KpiData {
}


How would the mapping look like? I'm kind of stuck.. I tried a solution with list of composite-element for Kpi to KpiColumn. But I didn't know how to continue with KpiColumn to KpiData.

/Carl


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.