How to create assosiation in java action on eclipse ?

  Hi all, I try to create mendix object with statement   IMendixObject messageObject = Core.instantiate(context,"mymodule.department"); IMendixObject messageObject = Core.instantiate(context,"");   I have relation as picture below . After I create department and team  , how to create assosiation “team_department”  in java systax ?
2 answers

Your Mendix project should have created proxy classes that can handle this for you if you have used Deploy for Eclipse.

Have a look in the javasource / mymodule (or whatever you are using) / proxies folder. 

You should be be able to instantiate a new instance of the class and set the association using these proxies. It should be as simple as something like this.

Team team = new Team(context);



This can help you:

  • In a microflow, set an association between the objects
  • (Run application)
  • Go to the javasource folder and open the generated file