Hi,
When persisting an entity i am getting an ORA-400 error with on a field marked as "nullable=false".
I have a list of Allotement on a entity named Dosssier. I first persist every Alllotement. I put them in the list and persist the Dossier :
// creating / persisting the Allotement list
List<Allotement> allotements = allotementService.createAllotementsFromLots(dto.getLots(), dto.getContactUtilisateur());
dossier.setAllotements(allotements);
dossierService.save(dossier); // getting ORA-400
The following exception is raised when persisting :
Internal Exception: java.sql.SQLException: ORA-01400: cannot insert NULL into ("PORTAILLB"."DOSSIERS"."IDALLOTEMENT")
My mapping is as following :
I have a @OneToMany relation on the DOSSIERS table
@Entity
@Table(name = "DOSSIERS")
public class Dossier extends AbstractEntity implements Serializable {
//...
@OneToMany
@JoinColumn(name="idallotement", referencedColumnName="idallotement", nullable=false)
private List<Allotement> allotements;
}
This maps the idAllotement of the composite primary key of Allotement
@Entity
@Table(name="ALLOTEMENTS")
@IdClass(AllotementPK.class)
public class Allotement extends AbstractEntity implements Serializable {
}
public class AllotementPK implements Serializable {
private Long idAllotement;
private Long lot;
Any hints as why eclipselink would not insert the idallotement on the Dossier table right away ?