Spring Data : issue with OneToMany, child not saved properly
up vote 1 down vote favorite I am having trouble dealing with @OneToMany relationship. Here is my code : @Entity @Table(name = "type_mouvement") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class TypeMouvement implements Serializable private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @OneToMany(mappedBy="typeMouvement", fetch = FetchType.EAGER,cascade = CascadeType.PERSIST) private List<CompteTypeMouvement> comptes; ... @Entity @Table(name = "type_mouvement_comptes") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) public class CompteTypeMouvement implements Serializable private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String numCompte; @ManyToOne private TypeMouvement typeMouvement; ... How I use these entities : TypeMouvement typeMouvementFromDB...