Entity Inspector import/export of many to many relationships

Hi. I am using the Entity Inspector screen to export/import seed data. I am having trouble exporting attributes having a many to many relationship. I suspect this is because I am not using a Link Entity but instead using the @JoinTable annotation. Can someone please confirm that it is necessary to create a Link Entity in order to export and import a many to many relationship? Thanks.

Hi,
Entity Inspector only loads, displays and exports *-to-one attributes of entities. *-to-many references cannot be exported using this screen. If you need to export complex object graphs, you’ll have to do in your application using the EntityImportExportService. As an example, take a look at how roles import and export are implemented in the com.haulmont.cuba.gui.app.security.role.browse.RoleBrowser.

Thank you. The example was very helpful. This is a very powerful feature. I wish there was more documentation on it, especially regarding the EntityImportView. But I was able to figure things out through trial and error.

Take a look at the javadoc of the EntityImportView class. There is a bit of information there.

Its interesting. I’ve tried to export roles but got an empty json-file. What am i doing wrong? It is nessecary foк me to migrate data from old system with many-to-many relations. What is the correct road map to do so?