Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » grandparent - parent - child link entity
grandparent - parent - child link entity [message #2641] Thu, 30 December 2010 11:15 Go to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
I have a link entity showing valid combinations of two other entities and easily code this using a LINK pattern.
However, I now want to relate that table back to itself using senior and junior relationships.

The completed relationships will give valid junior combinations, based upon valid senior combinations.

However, I can't determine if there is a pattern that will allow me to represent this within the framework. I think it needs a MULTI version of the LINK pattern.

Do you have any suggestions for this?

Thanks,

Graham
Re: grandparent - parent - child link entity [message #2642 is a reply to message #2641] Fri, 31 December 2010 04:46 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
Can you provide me with the relevant database schema so that I have something more concrete with which to work? I'm afraid your description is not accurate enough.

Re: grandparent - parent - child link entity [message #2643 is a reply to message #2641] Fri, 31 December 2010 10:22 Go to previous messageGo to next message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Hi Tony,

I'm afraid I don't have an easy way to draw the schema so I hope the following rambling description will suffice. Please let me know if this creates additional questions.

The application will be to allow a person to create a dance routine for a given dance type from a set number of figures.

Table dance_type
- dance_type_id (PK)
- other columns

Table figure
- figure_id (PK)
- other columns

Table dance_figure (link table allowing many-many between dance_type and figure)
- dance_type_id
- figure_id

Now a new link table is introduced and relationships used to join dance_figure to itself in a many-many relationship

Table follow
- dance_type_id
- figure_id
- follow_id

Two relationships between dance_figure and follow usng figure_id and follow_id as foreign key
1 - dance_type_id and figure id as snr
2 - dance_type_id and follow_id as jnr

The concept is that a dance_type consists of a number of figures. A figure may exist in more than one dance_type (hence many-many link relationship using dance_figure).

Any figure (within a particular dance_type) can have one or more allowed following figures.

Therefore, I need to be able to able to specify for each row in dance_figure, which other figures are valid follows (it isn't allowed to mix dance_types, so dance_id as follow does not need to be included in the follow table).

In terms of the framework, I wanted to be able to navigate from the dance_type list screen to a link screen allowing the valid dance_figures to be selected (this part is easy and is complete). However, for a selected dance_figure I then want to navigate to another link screen to select the valid follows.
Re: grandparent - parent - child link entity [message #2644 is a reply to message #2643] Fri, 31 December 2010 12:15 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2367
Registered: April 2006
Location: Surrey, UK
Senior Member
Are you aware that a LINK1 pattern is not the only way to maintain a one-to-many relationship? A many-to-many is actually two separate one-to-many relationships, and you can only deal with one of those relationships at a time.

The MENU system already contains examples of different patterns to maintain the same relationship:

  • in 'List Task (menu)' there are 'Menu Items (1)', 'Menu Items (2)' and 'Menu Items (3)'.
  • in 'List Task (process)' there are 'Nav Buttons (1)', 'Nav Buttons (2)' and 'Nav Buttons (3)'.


It is not possible to have a MULTI1 version of the LINK1 pattern as they deal with a different number of entities.

You will need to have a non-LINK1 task which maintains the contents of 'dance_figure' so that it can have navigation buttons which allow you to choose a row and jump to a task which maintains 'follow'.


Re: grandparent - parent - child link entity [message #2645 is a reply to message #2641] Fri, 31 December 2010 13:06 Go to previous message
gpatti is currently offline  gpatti
Messages: 283
Registered: August 2008
Senior Member
Thanks Tony,

I've been using the system for a long time and it's only just dawned on me from your reply that I don't have to use a LINK pattern for a link table. I had never really looked at the (2) and (3) buttons for Nav and Menu. If I had I would have realised.

Thanks,

Graham
Previous Topic: Delete with Cascade
Next Topic: RIGHT JOIN in LINK
Goto Forum:
  


Current Time: Fri Nov 22 14:47:31 EST 2024

Total time taken to generate the page: 0.01166 seconds