I’ve got a mask where you can enter an invoice. During this process you are allowed to create and edit new companies (costumers / suppliers) and use them immediately. Also some values can be changed in the chosen company when hitting some buttons in the screen, where you actually edit the invoice.
I had to do this, to get it to work without errors:
invoice.setSupplier(dataContext.merge(dataManager.commit(supplierCompany)));
… where supplierCompany
is an entity, that changed.
I only want to know, if this is the correct way of doing this?