Hi ,
iam using Hibernate/JPA , i have self relation with Composite forign key , i can't do the DML operations on the Assosiation Fields , so i made them read-only (inseartable and updatable false) , and i created @Column for that field ,
@ManyToOne(fetch= FetchType.EAGER)
@JoinColumns({@JoinColumn(name = "ELM_TYPE",referencedColumnName = "ELM_TYPE",insertable = false, updatable = false),
@JoinColumn(name = "PARENT_SEG_IDX",referencedColumnName = "SEG_IDX",insertable = false, updatable = false)})
private ElmSegmentList elmSegmentList;
but on certain cases it gives me the following exception :
Error while commiting the transaction object references an unsaved transient instance - save the transient instance before flushing: com.omnix.gsis.setup.model.ElmSegmentList.elmSegmentList -> com.omnix.gsis.setup.model.ElmSegmentList
but it works fine if i provided the values for both the Column and the ALL of the assosiation fields , is this sense and why !!!!???
Regards,
|