Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » How to work with many-to-many entity relations?
How to work with many-to-many entity relations? [message #977737] Fri, 09 November 2012 14:32 Go to next message
André T. is currently offline André T.Friend
Messages: 5
Registered: November 2012
Junior Member
firstly, appologise if I am opening a topic which is already discussed. Unfortunately I haven't found anything related.

Also, I am at a very early stage with Scout, done the tutorial on 3.7 and 3.8 minicm, so far.

When I have the tables with a many to many relationship, I would like to know how to use the AbstactPageWithTable to link the two main tables together. If you could point me in the right direction, it would be highly appreciated.

Hope my short description makes sense.

Thank you,
Re: How to work with many-to-many entity relations? [message #980591 is a reply to message #977737] Sun, 11 November 2012 20:32 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin KiekeboschFriend
Messages: 330
Registered: August 2011
Senior Member
In our application we have users and roles. We have table pages that show all the users and table pages that show the roles. There exist a m-to-n relationship between these two.

Then if you select one particular role, and open a form that shows the details of that role, it shows the name and a description, and the list of users that are connected to that particular role.
Then on this list you can add menu's to make it possible to add or remove users.

I hope this helps,

regards Bertin
Re: How to work with many-to-many entity relations? [message #981113 is a reply to message #977737] Mon, 12 November 2012 06:56 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 124
Registered: November 2010
Senior Member

If I may add a more complex example:

In an outline-based application, you will represent your entities in a tree. A tree is suitable for one to many relations: when you expand one node, you see all related entities.

Lets take this database as example (Source: Oracle MySQL - Sakila)


As you see, you have a many to many relation between films and categories and between films and actors.

When you have fixed one category (resp. one actor), you have many film that belongs to this category ( this actor). A possibility is to add a FilmsTablePage as child page of the CategoriesTablePage (resp. of the ActorsTablePage). In this FilmsTablePage you load only the films that belong to the category (resp. the actor) corresponding to the row in the parent table page.

You get something like this for categories:

And something like this for actors:

This is comparable to:
MiniCRM Tutorial - Write the second page

Now consider the films: for one film, there is many categories and many actors.
A solution is to add a node page for each film. This page contains two table page (one for category and one for actor).


See: MiniCRM Tutorial - Reorganize the tree.

To summarize here the pages tree:
  ├─Films Table Page
  │  │
  │  └─Film Node Page
  │     │
  │     ├─Actors Table Page
  │     │
  │     └─Categories Table Page
  ├─Categories Table Page
  │  │
  │  └─Films Table Page
  └─Actors Table Page 
     └─Films Node Page

Do not hesitate to ask question on the forum.


[Updated on: Mon, 12 November 2012 06:57]

Report message to a moderator

Previous Topic:Project Export's build logs are deleted, so it's impossible to know what went wrong
Next Topic:Refreshing the pages
Goto Forum:

Current Time: Tue Jun 19 09:03:46 GMT 2018

Powered by FUDForum. Page generated in 0.02295 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top