Regarding the many-to-many entities in the domain model

0
Hello.   ・Assumption. I have a many-to-many relationship between two entities, "member" and "project."   ・what we want to do. I want to show all the projects that this member is participating in on the homepage that displays member details. The reverse is also the same. Please let me know how to do it.   ・Remarks I think in a typical DB you would create an intermediate table with "member" and "project" keys, is this idea correct?
asked
3 answers
0

Hi Ryoma,

From your reference screenshot, I see you have added reference set between Member and project entity and also third joining entity.
You should consider either of this way and not both.

For accessing details on the page, check in which context entity values can be fetched. In case all entities are needed and not available via direct context you can use Microflows to load data in page widgets.

 

Regards,
Vaishali

answered
0

Hi Ryoma,

 

As you want to fetch project details for a logged in member, make sure your Member entity is associated with Account entity.

 

For associating Member and Project, as its a m-n(many-many) reference, you could do a setup like below image.(Decide the ownership entity as per you requirement.)

I would prefer going through below learning path to make informed decision on impact of ownership and m-n relationship in entity model. m-n associations has performance impact if both tables are growing.

https://academy.mendix.com/link/modules/371/lectures/3010/4.1-Impact-of-Ownership-

 

 

You can consider adding indexes on tables to improve performance.

 

I would prefer below combinations on my dataset before going for final design.

  1. Get all projects for a member. Needed?
  2. Get all members for a project. Needed?
  3. Add members in project. Screen needed?
  4. Add projects for member. Screen needed?

Consider below for during overall design.

  1. Ease of access to fetch data during screen designs.
  2. Data retrieved during operations.
  3. Data cached during overall project navigations.
  4. Which table will grow.

 

You could also consider having a joining entity in case both tables are growing in data.

answered
0

Thank you Vaishall.

 

I will also check the learning path you provided.

 

Additional question.

 

I have modified the domain model as shown in the attached image.

When I add a member, I want to select the project in the drop down, but the project does not appear as shown in the image below.

 

How can I get the project to show up on the parameters screen for the member?

 

Thank you in advance for your help.

answered