-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem formulating join select query with composite keys.
PostPosted: Wed May 26, 2004 7:49 am 
Regular
Regular

Joined: Tue May 11, 2004 9:23 am
Posts: 69
Hey,

I want to perform a join between two tables CustomerorderT and CustomerorderlineT. The thing is that I have composite keys in both tables.

Below is my select query so far, what I want to get out. I haven't formulated the WHERE statement since that's what I'm wondering about. I believe I can't use the prefix "id" since that checks after the primary keys and more important in hibernate I have the keys in a separate files (CustomerorderTPK and CustomerorderlineTPK) and they got no hbm.xml file so I can't use them in the query.

Code:
Query q = session.createQuery("SELECT co.customerorderno, co.deliverydate, co.status, co.paymentmode, co.freightcost, co.totalcost, "
      + "colT.orderlineno, colT.articleno, colT.articlename, colT.price "
      + "FROM net.sf.hibernate.CustomerorderT co, net.sf.hibernate.CustomerorderlineT colT, "
      + "WHERE ");



So how do I write my select query with a correct join?


Br. Newman


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 26, 2004 8:52 am 
Regular
Regular

Joined: Tue May 11, 2004 9:23 am
Posts: 69
Does anybody know what's wrong with my query?


Br Newman


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.