Hi all,
Please I need your help with removing entity using custom DataStore.
I have followed the sample Jmix (external-data-sample) to replicate same thing for my project.
I am able to perform loading, creating and updating following the sample. I realise that the removing is not working. I also realise that it is not being triggered in the datastore like the others.
See the custom datastore implementation (save method)
This is expected to be triggered for all the CRUD but the Deleting is not being triggered when I click the Remove button to delete an entity. As a result, removing entity is not working.
Please advise what is wrong. It is not working for the Jmix sample project also.(jmix-samples/external-data-sample at main · jmix-framework/jmix-samples · GitHub)
Thanks in advance.
@Override
public Set<?> save(SaveContext context) {
Set savedEntities = context.getEntitiesToSave().stream()
.map(entity → businessPartnerService.save((BusinessPartner) entity))
.collect(Collectors.toSet());
context.getEntitiesToRemove()
.forEach(entity -> businessPartnerService.delete((BusinessPartner) entity));
return savedEntities;
}