I have 2 tables lets say fi
and branchMst
:
------------------ ---------------------
| fi | | branchMst |
------------------ --------------------
| fi_id | | branchId |
| uid | | branchCode |
| branch_code | | branchName |
------------------ ----------------------
Now in order to get UID and Branch Name of each fi :
SQL:
select uid,branchName from fi left join branchMst bm
on fi.branch_code=bm.branch_code;
It will provide me the desired Records but i want to do the same via Hibernate Associations .
Some doubts :
1) branchCode is not primary Key in branchMst , so how to define my one to many association.
2) If i define association on 5 tables and i want data from 2 tables only , will All assocation mappings still applies ?