-->
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: Hibernate 3 not able to recognize the "ON" word in sql
PostPosted: Tue Nov 10, 2009 10:45 am 
Newbie

Joined: Tue Nov 10, 2009 10:36 am
Posts: 1
Hello All,
Am using hibernate with MSSQL where am having a query which is joining 4 tables with "ON" condition
Code:
SELECT
V.Description AS Vendor, P.ProductNumber, R.VendorItemNumber, P.Description, ISNULL(I.InventoryAmount, 0) AS InventoryAmount,
ISNULL(I.ThresholdAmount, 0) AS ThresholdAmount
FROM  tbProducts P  JOIN tbRacks R  ON P.ProductNumber = R.ProductNumber  JOIN tbRacksVendors V   ON R.VendorID = V.VendorID
LEFT JOIN tbInventory I   ON P.ProductNumber = I.ProductNumber  Join tbBrands T   ON P.brandid=T.brandid  order by
  V.Description asc

Its giving an error at "ON" condition even I checked "WITH" condition but failed even with that.
But the same code is working in MSSQL properly, so the problem is with Hibernate


Top
 Profile  
 
 Post subject: Re: Hibernate 3 not able to recognize the "ON" word in sql
PostPosted: Wed Nov 11, 2009 9:07 am 
Expert
Expert

Joined: Thu Jan 08, 2009 6:16 am
Posts: 661
Location: Germany
Remember that in HQL joinColumns are automatically inserted, these are read from your mapping file.
http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#queryhql-joins

_________________
-----------------
Need advanced help? http://www.viada.eu


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.