-->
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: Suggestions Please - Many To Many With A Twist?
PostPosted: Fri May 14, 2004 8:49 am 
Beginner
Beginner

Joined: Wed May 12, 2004 2:52 pm
Posts: 36
This is an unusual many-to-many mapping question because it involves mapping four tables togeather instead of three. Interested? Read on...

Here is the problem:

Complaint
----------
complaintId (PK)


Reason
----------
reasonId (PK)


SpecificReason
----------
specificReasonId (PK)
reasonId (FK)



Vanilla right? Wrong. This is where it gets interesting!

ComplaintReasonAssoc
----------
complaintId (FK, Composite Key)
reasonId (FK, Composite Key)
specificReasonId (FK)
sequence


What is the logic behind this maddness? A "Complaint" can have 1:M "Reasons". These reasons are ordered by "sequence". Each "Reason" has a 0:1 relationship with "SpecificReason".

Any suggestions on how to map this? Because there is a 1:1 mapping between "ComplaintReasonAssoc" and "Reason", I thought it was an ideal candidate for a many-to-many mapping (from "Complaint" to "Reason"). The problem with this is that I am not sure how to pick up the specificReasonId and sequence number.

Your help is appreciated!

Regards,

Joshua


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.