Self-Reference Domain Model

0
Hi everyone,  I’m trying to build a hierarchy of documents in Mendix using a Self-Reference: No matter what i do, i can’t call a list with more than one object from the parent...What am I doing wrong?!? Best, Tom
asked
3 answers
2

Check if this document helps you: https://docs.mendix.com/refguide/query-over

There is something called reversed() which can be used in self-referencing. May be in your case, you might need this. 

Problem with self referencing is, parent and child are same, so, it might become bit hard to get the associated objects if your parent is actually different than what you expect. 

In those cases, reversed will help you.

answered
2

As you data is non-persistant retrieving through a self-reference can be challenging.

you could setup your domain model like this, this creates insight and cannot return a parent when retrieving a child.

answered
1

If you are having trouble retrieving the information, it is always handy to try with a datasource microflow where you have more control on the way of retrieving the information. Maybe try that.

On the other hand check the navigability of your association (double click on the association in your domain model). This helps with understanding why you might not be able to easily retrieve the list.

answered