Hello friends, I am new to Hibernet so pardon me for asking this basic question.
If we have two tables , TABLE A and TABLE B
Table A | Table B ---------------------------------------------------------------------------------- PK_ID COLA1 COLA2 COLA3 | PK_ID COLB1 COLB2 COLB3 A1 1 abc pqr | B1 1 abc pqr A2 2 abc pqr | B2 1 abc pqr A3 3 abc pqr | B3 1 abc pqr A4 4 abc pqr | B4 1 abc pqr ----------------------------------------------------------------------------------
PK denotes Primary KEY of the Tables /***************************/ if i want to write a query
select COLA1,COLB2,COLA3
from TABLE_A _a , TABLE_B _b
where _a.PK_ID=_b.PK_ID _a.COLA1=_b.COLB1 AND _a.COLA2=_b.COLB2
/**************************/
[color=#FF0000][color=#FF0000][color=#FF0000]How will I design this in my Hibernet TABLE_A.hbm.xml and TABLE_B.hbm.xml file
How will I Write the HQL for this?? And WHAT WILL MY JAVA PERSISTENT CLASS LOOK LIKE.
Please Help me out as I am new to Hibernet and I need to do this as quick as Possible..[/color][/color][/color]Lots Of Thanks in Advance..!!!!
|