I have problem with composite primary key and Foreign key having the same column name.
Example
Table A PK (ID , NEW_ID)
Table B PK (ID, NEW_ID) FK (A_ID, NEW_ID)
I have the relationship of Entity B mapped to A in this way
@ManyToOne
@JoinColumns({@JoinColumn(name = "A_ID", referencedColumnName = "ID"),
@JoinColumn(name = "NEW_ID", referencedColumnName = "NEW_ID")})
When I try to save B. I am getting an error of invalid Index.
So I am guessing it was also trying to set NEW_ID two times and getting this error.
I have no option to set one column as insertable and updatable as false.
Can any one help me in this