“The [reversed ()] expression can only be applied on self-references. When an association is between two different object types, the platform will be able to determine the direction of the join automatically.”
The first statement explains that reversed() can only be used in self references. The second statement explains why reversed() is not useful for references between different object types – there, the platform can always determine the direction of the association automatically, because there is a known owner of the association.
Imagine a reference LineItem → Order
Here, when traversing the association, the direction is clear.
Now imagine a self-reference of User
Which User is the owner? Each user may have a parent and/or a child, so you need to be able to explicitly tell it which way the association should be traversed.
Hi Sameer!
IMO
We cannot use the [reversed()]
expression in the context of two different object types, just self-references.
Kindly refer https://forum.mendix.com/link/space/app-development/questions/2882 as well.
And the end part of the doc Querying-in-Reverse refers to querying specialization objects with the help of a java action to get the parent object from the specialized object.