| Author |
How to write HQL to retrive Child object(From list) on the basis of Parent?
|
Navnath Kumbhar
Greenhorn
Joined: Mar 07, 2010
Posts: 12
|
|
Hi There,
I have Class structure as following
There is Hibernate mapping created for this structure.
Three tables are created for this mapping
tbl_parent
tbl_lstChild
tbl_child
Now I want to fetch Child object where I have parent object with me.
Query in simple SQL is
select * from tbl_child tc inner join tbl_lstChild tlc on
tc.id=tlc.child_id where tlc.id=123
Above query is working fine.
Now How do I write same query in Hibernate(HQL)?
Please hel me
Thank You in advance.
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
|
Could you show your query and tell us why it is not working (properly)?
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Navnath Kumbhar
Greenhorn
Joined: Mar 07, 2010
Posts: 12
|
|
Hi,
Thanks for replay.
I have resolved it.
Query is
select lc from Parent p inner join p.lstChild lc where p.strId=? and lc.name=?
Thank You.
|
 |
 |
|
|
subject: How to write HQL to retrive Child object(From list) on the basis of Parent?
|
|
|