-->
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: which mapping?
PostPosted: Mon Oct 11, 2004 11:45 am 
Newbie

Joined: Mon Oct 11, 2004 11:29 am
Posts: 11
Hi,
I have a question on how to map the following situation:
I have two tables: INDIVIDUAL_NOTES and INDIVIDUAL.
The notes table links to the individual table via I_IID column which is the pk of the notes table but not a pk of the individual table. This is because i am keeping versions of individuals but i want them all linked to the same notes. So the individual table has its own pk I_ID and I_IID is shared by all versions.

Any idea on how to map this in hibernate?

Thanks
-Igor

create table INDIVIDUAL_NOTES (
I_IID varchar(20) not null,
IN_NOTES varchar(5000) null,
primary key (IN_IID)
);

create table INDIVIDUAL (
I_ID numeric(19,0) identity not null,
I_IID varchar(20) not null,
I_EFFECTIVE_DATE datetime not null,
I_CURRENT tinyint null,
U_NAME_FIRST varchar(20) not null,
U_NAME_LAST varchar(20) null,
U_NAME_MIDDLE varchar(1) not null,
primary key (I_ID)
);


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.