-->
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.  [ 3 posts ] 
Author Message
 Post subject: Multiple parent table question
PostPosted: Fri Jun 29, 2007 9:03 am 
Newbie

Joined: Tue Feb 20, 2007 12:04 pm
Posts: 16
I have a fairly classic Parent/Child mapping relationship that I'm using to manage "media" (child) for individual "providers" (parent). Each "provider" parent will have one or more "media" children, and the media can be transient in nature.

Here's the problem -- I really want another parent table to maintain a "master" index of media information (things like title, artist, album, genre, etc.). Example: any number of "provider" parents could have the same "media" entries, and I'd like to maintain some "master" index to catalog this information in a central/persistent location.

So, if I add a new provider or update an existing one to the system, I'd like to:

1. Add/update all "media" children for the "provider".
2. Add any unique/new media records in another "master" parent table.

The parent-child relationship between "provider" and "media" is very simple and works beautifully, but I'm not even sure where to start with the "master" table.

Any ideas?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 29, 2007 1:27 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
It sounds like you need to transition from a parent-child (one-to-many) relationship to a many-to-many relationship, either directly or through an association class (if there are attributes specific to a relationship between a "media" and a "provider").


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 29, 2007 2:47 pm 
Newbie

Joined: Tue Feb 20, 2007 12:04 pm
Posts: 16
I'm not sure I follow. Regarding relationships, the "provider" parent and "media" child share a "ProviderId" attribute, while the "master" parent and "media" child share a "MediaKey" attribute.

So, each "provider" is linked with "media" via a ProviderId -- I already have this relationship working. But, I need to figure out how to map the relationship with "master", which is linked with "media" via a MediaKey.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.