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: Collections with Iquery
PostPosted: Thu Mar 11, 2010 6:45 am 
Newbie

Joined: Thu Mar 11, 2010 6:13 am
Posts: 1
Hi,

I'm using Iquery for my search screens. The below is my Iquery from which i'm getting list of salesorders.

select so.SalesOrderIdentifier,
so.SalesOrderSuffix,
so.PurchaseOrder.PurchaseOrderIdentifier,
so.DivisionCustomerIdentifier,
so.TagName,
so.OrderDate,
so.DivisionSalesOrderStatusType.StatusTypeCode,
so.ShipVia,
so.LoadNumber,
so.RequestedDeliveryDate,
br.Name
from SalesOrder so
left outer join so.SalesOrderLines sol
left outer join sol.ProductInstance po
left outer join po.ProductOptionInstances poi
left outer join poi.DivisionProductOptionInstanceType dpoit,
Brand br
where dpoit.TypeCode = 'BRD'
and poi.Value = br.BrandCode
and so.
group by so.SalesOrderIdentifier,
so.SalesOrderSuffix,
so.PurchaseOrder.PurchaseOrderIdentifier,
so.DivisionCustomerIdentifier,
so.TagName,
so.OrderDate,
so.DivisionSalesOrderStatusType.StatusTypeCode,
so.ShipVia,
so.LoadNumber,
so.RequestedDeliveryDate

Here brand will be obtained through the tree of the salesorder.SalesOrderLines.ProductInstance.ProductOptionInstances.Value.

The value is the Brand code in the SalesOrder tree. I need to get the collection of the brand Names for each salesorder whose Name is avaliable in Brand table.

How can i acheive this through IQuery?

Can any one help me out of this?

Sample Data:

SalesOrderID Date Brand
12000 12-02-2009 Br1
12000 12-02-2009 Br2
12001 Null Br1
12002 Null Br2
12003 01-02-2010 Br1
12003 01-02-2010 Br2

If u consider this as a sample data through which i got from the above query. I need to get only the unique salesorder. i.e

SalesOrderID Date Brand
12000 12-02-2009 List(Br1,Br2)
12001 Null Br1
12002 Null Br2
12003 01-02-2010 List(Br1,Br2)

This is my agenta. Is it possible with this?


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.