-->
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 one to many component not using primary key
PostPosted: Tue Mar 08, 2005 2:53 pm 
Newbie

Joined: Mon May 10, 2004 2:28 pm
Posts: 10
Location: Seattle, WA
I have a somewhat theoretical question. I have an abstract entity, Content, which has a large number of joined subtypes (Image, Story, Movie, etc). The primary key on the Content table appears in each sub types's table but each subtype has an additional synthetic key. As far as the database (oracle 8i) is concerned the synthetic key is the primary key on the sub type tables.

The tables are pretty big so here is the abridged versions:

Code:
CONTENT (ID number(12), .....);

IMAGES(CONTENT_ID number(12), --FK to CONTENT
             ID number(12) PRIMARY KEY, -- comes from a sequence
             ....);


I have successfully mapped the subtypes using the primary key in the Content table joining it to the appropiate FK in the sub types. I have to manually ask Oracle for the correct sequence to safisy the PK constraint.

The difficulty comes in with components which hang off the sub types. They are keyed off the the (synthetic) sub type primary keys.

Code:
IMAGE_DETAILS(IMAGE_ID number(12), -- PK to IMAGES
                          ....); 


Does anyone have any good advice as to how to allow the inheritance and component behaviours with these keys?


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.