Say, I have ProjectA, ProjectB all plugged with MyAddon. And I defined an entity name MyAddonEntity.
For ProjectA, I want MyAddonEntity linked to the main datastore of ProjectA.
But for ProjectB, MyAddonEntity need to be linked to an additional datastore defined by ProjectB.
Is there any solution? Change dynamically by code, or statically by config file are all ok with my case.
In the MyAddon, MyAddonEntity is mentioned in the persistence.xml.
You should open app component descriptor app-component.xml and remove exporting the cuba.persistenceConfig property:
In the ProjectA - manually add mentioned above persistence.xml to the list of persistence files of the main datastore, in web-app.properties and app.properties: