I would like to associate 2 entities using sleep mode annotations with a user connection suggestion. The proposition relates to the usual equality FK / PK, but also to where FK is zero. In SQL, it will be something like this:
join b on a.id = b.a_id or b.a_id is null
From what I read, I have to use the @WhereJoinTable annotation in the owner entity, but I'm puzzled by how I define this condition ... especially the first part - with reference to the connection object identifier.
Does anyone have an example?
java sql annotations hibernate
mysomic
source share