getReferences (..) in JAVA results only in *->1 associations
1
When I want to get all the associations of a Mendix Object in JAVA, I use the getReferences (..) command to do so. This only gives me the associations of type ->1 of which the Mendix Object is the owner. What I need is an association of type *->, also of which the Mendix Object is the owner. Can anybody tell me why I don't get to see these in the results of the getReferences (..) command? I think this is because this command can only show *->1 relations, but why? The Object owns the association, so my initial thought would be that it would show up. Is there another way to get -> as a result?
asked
Rochus Meijer
2 answers
2
I haven't verified this, but this is probably due to the fact that an association still has a parent (you can see this in the domain model in the associations tab for an entity) even if you set the association type to both. It shouldn't be overly complicated to get all references from all entities and find the correct ones. You can have a look in the Java code of my 'Random Data Generator' App Store module for an example.
answered
Sebastiaan van den Broek
0
yes we managed to get all declared associations with metaObject.getDeclaredMetaAssociationsChild() and metaObject.getDeclaredMetaAssociationsParent()