-->
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.  [ 2 posts ] 
Author Message
 Post subject: many-to-one where one may be in different tables?
PostPosted: Tue Aug 23, 2005 12:03 pm 
Newbie

Joined: Tue Aug 23, 2005 11:50 am
Posts: 1
How do you map many-to-one with generic parent? What's the proper term in the documentation?

For example:

Code:
create table a (
a_id char(32) primary key not null,
briefdesc varchar(250));

create table b (
b_id char(32) primary key not null,
briefdesc varchar(250));

create table c (
c_id char(32) primary key not null,
parent_id char(32) not null,
fulldesc text);


Using uuid keys c.parent_id could refer to either a.a_id or b.b_id. How do I map this or do I need to change my schema? Suggestions? Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 23, 2005 12:20 pm 
Expert
Expert

Joined: Wed Apr 06, 2005 5:03 pm
Posts: 273
Location: Salt Lake City, Utah, USA
You could look at the <any> tag, and add a type column to c to tell which 'parent' table c references.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.