-->
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: problem in ordering two table abject in one
PostPosted: Fri Apr 18, 2008 3:21 pm 
Beginner
Beginner

Joined: Fri May 11, 2007 11:03 am
Posts: 32
I am facing a unique problem. I have three different tables say Task, StepGroup and Step. The relation between these tables is a many to many. In other words :a Task can have number of StepGroups and also a number of Steps.
:a StepGroup can have a number of Steps and also can be in a number of Tasks
: a Step can be in a number of Tasks and also in a number of StepGroups

Uptill this, its fine and I am able to get things to work.
To acomplish this I have three join tables between them.
Now not only a Task can have a number of StepGroups and Steps. They need to be in a specified order.
Example :
Task1 can have--
Step1
StepGroup2
Step5
Step9
in that order

Task2 can have--
Step5
StepGroup1
StepGroup4
Step6
in that order

I am having hard time to reflect this in the database.
One thing I could think of was to make another table in which there would
be three columns being three foreign keys from three different table where one would make sure that either one of the step and stepgroup foreign keys would be null for a given row.And it would have an id column which would determine the order. But I dont know would it be the right thing to do?

Could somebody suggest a good database design in order to accomplish this releationship.



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.