-->
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.  [ 1 post ] 
Author Message
 Post subject: problem with HQL outer join
PostPosted: Tue Jul 04, 2006 3:17 am 
Newbie

Joined: Tue Jul 04, 2006 2:50 am
Posts: 1
Location: India
Hi, I am trying to execute a HQL query which has an outer join. It is giving an exception. Can someone help me correct the query?

Code

Code:
public static final String FIND_DELIVERYNOTE_LINEITEM_ETA_SHIFTS =
      " SELECT s.suppDelNoteLineItemId, s.spicsPartNumber, s.revisedEtaDate, po.dcaupPurchaseOrderId, " +
      " po.originalEtaDate, pli.quantityOrdered, v1.spicsCustomerNumber " +
      " FROM SupplierDeliveryNoteLineItemDO s " +
      " LEFT OUTER JOIN " +
      " FROM   CustomerBackOrderTempDO c " +
      " WHERE  c.spicsBoOrderTypeNumber IN ( " +
      " SELECT sot.spicsOrderTypeNumber " +
      " FROM   SpicsCustomerOrderTypeDO sot, OrderTypeDO ot " +
      " WHERE  ot.orderTypeId = sot.orderType.orderTypeId " +
      " AND    ot.orderTypeCode IN ('39', '38')) AS v1 " +
      " ON  (s.spicsPartNumber = v1.spicsPartNumber " +
      " AND s.deliveryNoteLineNumber = v1.lineNumber), DcaupPurchaseOrderLineItemDO pli, DcaupPurchaseOrderDO po " +
      " WHERE s.dcaupPoLineItemFid = pli.dcaupPoLineItemId " +
      " AND   pli.purchaseOrder.dcaupPurchaseOrderId = po.dcaupPurchaseOrderId " +
      " AND s.notificationFlag = 'N' " +
      " AND s.revisedEtaDate IS NOT NULL " +
      " AND s.etaVariation IS NOT NULL " +
      " ORDER BY (v1.spicsCustomerNumber) ";

Session session = getSession();
Query query = session.createQuery(FIND_DELIVERYNOTE_LINEITEM_ETA_SHIFTS);



Exception

org.hibernate.hql.ast.QuerySyntaxException: unexpected token: FROM near line 1, column 247
[ SELECT s.suppDelNoteLineItemId, s.spicsPartNumber, s.revisedEtaDate, po.dcaupPurchaseOrderId, po.originalEtaDate,
pli.quantityOrdered, v1.spicsCustomerNumber FROM com.dcx.wppaup.shared.domain.SupplierDeliveryNoteLineItemDO s
LEFT OUTER JOIN FROM com.dcx.wppaup.shared.domain.CustomerBackOrderTempDO c WHERE c.spicsBoOrderTypeNumber IN
( SELECT sot.spicsOrderTypeNumber FROM com.dcx.wppaup.shared.domain.SpicsCustomerOrderTypeDO sot,
com.dcx.wppaup.shared.domain.OrderTypeDO ot WHERE ot.orderTypeId = sot.orderType.orderTypeId AND
ot.orderTypeCode IN ('39', '38')) AS v1 ON (s.spicsPartNumber = v1.spicsPartNumber AND
s.deliveryNoteLineNumber = v1.lineNumber), com.dcx.wppaup.shared.domain.DcaupPurchaseOrderLineItemDO pli,
com.dcx.wppaup.shared.domain.DcaupPurchaseOrderDO po WHERE s.dcaupPoLineItemFid = pli.dcaupPoLineItemId AND
pli.purchaseOrder.dcaupPurchaseOrderId = po.dcaupPurchaseOrderId AND s.notificationFlag = 'N' AND s.revisedEtaDate IS
NOT NULL AND s.etaVariation IS NOT NULL ORDER BY (v1.spicsCustomerNumber) ]


Thanks,
SSR


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

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.