• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get child table values from parent query

 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2700
IntelliJ IDE Opera
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Reshma Reddy
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic