-->
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 two tables to one column
PostPosted: Mon Aug 28, 2006 8:02 pm 
Beginner
Beginner

Joined: Mon Jun 19, 2006 9:21 pm
Posts: 25
I have three tables, gateway, company, and affiliate. Both company and affiliate map to the same column in gateway. I use a column 'type' in the gateway table to figure out if it is a company or affiliate row.

Typically I will only want to update the company or affiliate table and not the gateway since the information in gateway will be set once, while the information in the other tables may be updated more often.

I also will always get to the gateway table through the company and affiliate tables, so the gateway doesn't need to know it's companies or affiliates except to insert/update.

So basically I need it to be like the following:
Affiliate ---> Gateway[RefID]
Company ---> Gateway[RefID]

With the affiliate and company within the gateway mapping being equivalent to a property that I can call with a simple getCompany or getAffiliate.

I have this same problem for another set of tables, except that it's five tables mapped to one, but I'm guessing the process is the same irregardless of the amount of tables one has.

This situation shouldn't be extremely uncommon so I'm guessing hibernate has a way to cope w/ it, just couldn't figure out how.

Thanks in advance for any help you can give me.


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.