Hi all,
I'm facing following problem: There is table A with two fields (not primary composite) and the same structure in table B - two non primary fields.
Is it possible to join these tables some how with annotation.
By using something like following
Code:
@JoinColumns({
@JoinColumn(name = "PRP_PERSON_CODE", referencedColumnName = "USR_PERSON_CODE"),
@JoinColumn(name = "PRP_PERSON_SSN", referencedColumnName = "USR_PERSON_SSN")
})
because generated SQL code is looks like following:
Code:
inner join ED_PERSON_PRIVILEGES privileges2_
on user1_.USR_PERSON_CODE = privileges2_.PRP_PERSON_CODE
AND user1_.USR_PERSON_SSN = privileges2_.PRP_PERSON_SSN
For me must be
Code:
inner join ED_PERSON_PRIVILEGES privileges2_
on user1_.USR_PERSON_CODE = privileges2_.PRP_PERSON_CODE
OR user1_.USR_PERSON_SSN = privileges2_.PRP_PERSON_SSN
OR between join fields not AND.
Is it possible with hibernate and annotation?