I have a claim table that has patient_id and employee_id. Both of these links link to the patient table because the are identical, and in many cases the employee is also listed as the patient. So, in the patient class I would like to retrieve all the claims for the given patient, something like getClaims()
I setup getClaimsAsEmployee and getClaimsAsPatient already:
Code:
<set name="claimsAsPatient" lazy="true">
<key column="patient_id" />
<one-to-many class="com.eldoserv.esdos.db.Claim" />
</set>
<set name="claimsAsEmployee" lazy="true">
<key column="employee_id" />
<one-to-many class="com.eldoserv.esdos.db.Claim" />
</set>
but I would like to make 1 additional set that links the patient to patient_id or employee_id ... How can I accomplish this? I would like to have it in the hbm file so that I can use it's values in queries, etc...
Thanks,
Jeremy