Hi,
I am getting this error when I attempt to save a child which has a unique composite key (sequence generated) but thesame PK. The issue only occurs when I try to save more than one child element with thesame child_key. Below is ths code. Please let me know any suggestions you may have. Been struggling with this for quite sometime now
@Entity public class Parent implements Serializable {
@Column(name="PARENT_KEY", nullable=false) @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ceremonyRecipientSeq") @SequenceGenerator(name="ceremonyRecipientSeq", sequenceName="PARENT_KEY_SEQ") private int parentKey
@OneToMany(cascade = {CascadeType.ALL}) @LazyCollection(LazyCollectionOption.FALSE) @JoinColumn(name = "PARENT_KEY", nullable=false) private List<Child> children= new ArrayList<Child>();
//getter, setters ..... }
@Entity public class Child implements Serializable{
@Id @Column(name="CHILD_KEY", nullable=false) private String childKey;
//getter, setters ..... }
|