1

I have two tables as follows:

 Table A:  
site  [pk]  
group [pk]


 Table B:  
group [pk]   
method[pk]  
gate  [pk]   

Composite key for A - [site-group].
Composite key for B - [group-method-gate].

How to Retrieve all records of A's table associated with B table on column Group value only? group can have multiple entries in both tables, not a unique column.

Both tables are independent on mysql, I have to make join in hbm file using group column available in both tables.

Something like as following on class B

<set name="SiteGroup" table="A"
        inverse="true" lazy="true" fetch="select">
    <key column="group"/> 
    <one-to-many class="A's as class " />
</set>
Shimon Rachlenko
  • 5,469
  • 40
  • 51
Piyush Aghera
  • 965
  • 7
  • 13

0 Answers0