wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes how to get child table values from parent query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "how to get child table values from parent query" Watch "how to get child table values from parent query" New topic
Author

how to get child table values from parent query

Reshma Reddy
Ranch Hand

Joined: Dec 21, 2006
Posts: 197
Hi All,

I want to get second(reference) table status using id in first query using hibernate.

I am calling select * from table1;
this table1 contains one column called referenceid. This reference id details will be there in table2 (id,status,date....etc). At time the of calling select * from table1 I want to get reference id status instedof referenceid.

Please provide any query.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

We don't provide concrete answers. We like you to find it out for yourself. You'll learn much more from it. Here is a hint: check out joins.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Reshma Reddy
Ranch Hand

Joined: Dec 21, 2006
Posts: 197
Hi Wouter,

Thanks for your post.
I don't want exact query I need just idea, so that i will try to write query.
and I know how to fetch child table status information using procedures. But here we are using select * from in query, with in this resultset i need to fetch.

I am looking into joins
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get child table values from parent query
 
Similar Threads
Hibernate: Different Join in Save() and Get()
how to get child table values from parent query
Update with subquery
two table mapping.
How do i implement this tricky requirement