I am trying to delete a row from a JPAContainer and I get the error (console trace)
se elimina el apunte 17
05-jul-2013 13:47:50 com.vaadin.Application terminalError
GRAVE: Terminal error:
javax.persistence.EntityNotFoundException: deleted entity passed to persist: [intergal.asambleas.data.ApunteCeldaMatriz#]
I am using the following relevant code:
public EntityContainer<ApunteCeldaMatriz> setuApuntesCeldaJPAContainer() {
apuntesCeldaEntityProvider =new MutableLocalEntityProvider<ApunteCeldaMatriz>( ApunteCeldaMatriz.class, JPAFactory.em);
apuntesCeldaEntityProvider.setEntitiesDetached(false);
apuntesCeldaJpaContainer.setEntityProvider(apuntesCeldaEntityProvider);;
apuntesCeldaJpaContainer.setReadOnly(false);
return apuntesCeldaJpaContainer;
}
private void eliminaEntrada(Integer keyApunte) {
System.err.println("[b]
se elimina el apunte "+ keyApunte
[/b] );//—> is show in the console with a value that exists database!!
apuntesCeldaJpaContainer.removeItem(keyApunte);
Why I get the error that “entity not found” If the id is fill with a value that exist in database?
Is there another way to delete the row?