hello,
I have a OneToMany relation between Pret and EcheancePret.
when i create one Pret, a list of EcheancePret is automaticaly created and inserted in the database,
but when i want to update my Pret, i have to delete the list of EcheancePret, create and insert a new one,
this is my code:
/*** PretHome.java ***/ Set<EcheancePret>listeEcheancePret=this.getInstance().getEcheancePrets(); for(EcheancePret echeance : listeEcheancePret) { this.echeancePretHome.setInstance(echeance); this.echeancePretHome.remove(); }
deleted entity passed to persist: [com.fitnetapplication.resources.model.EcheancePret#<null>]
You have to remove the EcheancePret from the EcheancePrets collection in Pret before you can delete it.