csr_1978 wrote:
gopal.knoah ,
My sql looks like this
select * from form f join form_version fv on f.oid=fv.form_oid and fv.name='name version1';
form table form_version table
------ ----------------
oid (pk) oid (pk)
form_oid (fk)
name
.........
The relation is one-to-many
In your form_version table, I think form_oid is pk and oid is fk
check it once. I m doing like this.....ok
try in this way now.
Hql :
FROM FormBean F
JOIN F.fv AS formFv
AND formFv.name = 'name version1'
Now go to FormBean.hbm.xml and put this mapping
<many-to-one name = "fv" class = "FormVersionBean" column = "oid" insert = "false" update = "false" />
Now go to FormBean.java and add this field
private FormVersionBean fv;
create its getter and setter
make show_sql true and see the sql at the console converted from this hql. u will get the same sql as u had given to me.
Thanks,
Gopal
[please rate, if helpful]