29
Views
5
Comments
Relationship between entities
Question

I have 2 entities, one for candidates and one for registration.

Candidates can have multiple entries.

I need to bring on the screen in a list the data of each candidate and the number of applications for each candidate

candidates who have no enrollments, presents the value 0

In the aggregate that brings the data of the candidates in the list, I cannot join with the registration entity. In that case, it will only bring the candidates who have registered.

So how can I resolve this situation?

2022-05-02 13-50-49
Paulo Ritto

Hi João,

The last part of your question makes me think that your aggregate is joining both entities with an Only With (INNER JOIN), and that's why it brings no results for candidates entity that have no entries in the registration entity. 

To fix this, you should open your aggregate, and in the sources tab, do a left join in this case (With or Without) between Candidates and Registration, to show up all Candidates, even, if they don't have any associated records in the Candidates entity.

Let me know if this helps!

Cheers,

Paulo

2026-02-24 21-20-41
João Elder Avelar dos Santos

That was exactly it. I didn't understand the relationship.

Sorted out. thanks too much

2022-05-02 13-50-49
Paulo Ritto

No worries,

If the answer helped you please mark my answer as solution so other people with the same issue can refer back to it!

Cheers,

Paulo

2023-10-27 12-06-14
Asiyah Munawwar

Hello João Santos ,

 Change the join to  with or without join between candidate and registration entities ,this will fetch all the candidate with or without registration.

Regards

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.