-->
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 foreign key from 2 tables using same Oracle sequence
PostPosted: Tue Jun 21, 2005 5:58 am 
Newbie

Joined: Tue Jun 21, 2005 5:37 am
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:2.1.6
Oracle 9i

Just starting to get my first hibernate app working and have managed a simple CRUD on a table, hoorah.

My problem is with my next mapping. I have a table that has a foreign key and I wanted to create a many to one mapping to the table that provides the key. In this case however, the foreign key is generated by an Oracle sequence and can come from one of 2 tables.

Eg:
tClient
Client_ID (PK)
Portfolio_ID (FK)
Description
etc etc

Portfolio_ID is the FK that can come from either of these 2 tables
tPortfolio
Portfolio_ID (PK)
Descr

or
tUserPortfolio
Portfolio_ID (PK)
Descr

This construct allows me to have the concept of one super set of portfolios, tPortfolio from an external source and tUserPortfolio created by users

Any ideas please on how or even if a mapping can be created that can do this

Thanks

_________________
ptc


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.