-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate multiple tables join query
PostPosted: Fri Oct 01, 2010 9:25 am 
Newbie

Joined: Fri Oct 01, 2010 9:21 am
Posts: 2
I am now using hibernate as ORM in my application

I am not that familiar with join query. So my question is as dipicted below:

Scenario:

I have got three tables.

Order Table
(PK)
ID ORDER_CODE STATUS

1 jialhe001 ORDERED
2 jialhe002 ORDERED


OrderProduct Table

(PK) (Order_PK) (Product_PK)
ID ORDER_ID QTY PROD_CODE

1 1 10 XXD
2 1 12 YYD

Product Table

(PK)
PROD_CODE description price

XXD toys 12
YYD cars 10


I need product.description, product.price, order.status, orderproduct.qty

How to write JOIN query?

P.S.:I have realized it by using other approach. But I am not satisfatied with that.
I am just wondering how to write query based on JOIN.


Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Hibernate multiple tables join query
PostPosted: Tue Feb 07, 2012 5:57 am 
Newbie

Joined: Wed Jan 25, 2012 1:59 am
Posts: 8
Hello
I am stuck with a similar issue.Please suggest a solution if you have got it working.
:(
Posted my topic here
https://forum.hibernate.org/viewtopic.php?f=1&t=1014372

Thanks
Sachin


Top
 Profile  
 
 Post subject: Re: Hibernate multiple tables join query
PostPosted: Tue Feb 07, 2012 7:17 am 
Newbie

Joined: Thu Jan 27, 2011 10:53 am
Posts: 12
Hi,
May you join your mapping (xml or annotated class)? It will be of great help to provide an answer.
Join query can be implicit by using manytoone, onetoone mapping.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.