Joined: Wed Dec 09, 2009 12:42 am Posts: 1
|
Hello, I have two tables Table A and Table B
Table A has following columns a_key - it is primary key a_id ac_id ac_name
Table B has following columns
b_key - it is primary key b_id bc_id ac_name_ref bc_lable
now ac_name column of table A has same value in ac_name_ref in Table B. but physically its not foreign key in Table B on database. ac_name one-to-many relation with ac_name_ref also a_id = b_id and ac_id=bc_id this is like for where criteria both columns has same values and same occurance.
for this Table A and Table B I have hbm files like follow.
A.hbm
<properties name="example"> <property name="aId" type="java.lang.Integer"/> <property name="acId" type="java.lang.Integer"/> <property name="acName" type="java.lang.Integer"/> </properties> <set name="B" inverse="false" fetch="join" lazy="false"> <key property-ref="example"> <column name=" bId"></column> <column name="bcId"></column> <column name="acNameRef"></column> </key> <one-to-many class="B" /> </set>
and If I fetch records for the same then I want records in such way ac_name | bc_lable bc_lable bc_lable bc_lable bc_lable i.e one ac_name will have n bc_lable s where ac_name = ac_name_ref
but I am getting results as 1 ac_name = 1 bc_lable where ac_name = ac_name_ref
where I am going wrogn please help me??
Thanks in advance
|
|