You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Rupinder Singh Mazara <rm...@masterfile.com> on 2006/06/28 18:36:02 UTC

doing a select distinct

hi all

  how can i carry out a "select distinct status_id from order_header 
order by status_id "
 via the delegator !

 thanks



Re: doing a select distinct

Posted by Alexandre Gomes <al...@gmail.com>.
Hi Rupinder,

   Something like this executed from a beanshell file will bring the
distinct statusIds from the OrderHeader entity.

    orderBy = UtilMisc.toList("statusId");
    findOpts = new EntityFindOptions();
    findOpts.setDistinct();
    fieldsToSelect = UtilMisc.toList("statusId");
    exprs.add(new EntityExpr("statusId", EntityOperator.NOT_EQUAL, null));
    condition = new EntityConditionList(exprs, EntityOperator.AND);
    statusList = delegator.findByCondition("OrderHeader", condition,
null, fieldToSelect, orderBy, findOpts);

   Regards,
Alexandre Gomes

On 6/28/06, Rupinder Singh Mazara <rm...@masterfile.com> wrote:
> hi all
>
>   how can i carry out a "select distinct status_id from order_header
> order by status_id "
>  via the delegator !
>
>  thanks
>
>
>

Re: doing a select distinct

Posted by Arnd Scharpegge <ar...@lynx.de>.
You can use one of those 'resultList = delegator.findByXX' (XX = one of 
the many methods) and for the distinct, you should refer to 
http://www.opensourcestrategies.com/ofbiz/ofbiz_entity_cookbook.txt 
(description at the bottom).


Arnd Scharpegge


Agrenon GmbH a member of Lynx Consulting Group, 
Johanniskirchplatz 6, D-33615 Bielefeld, Germany





Rupinder Singh Mazara <rm...@masterfile.com> 
28.06.2006 18:36
Please respond to
ofbiz-user@incubator.apache.org


To
ofbiz-user@incubator.apache.org
cc

Subject
doing a select distinct






hi all

  how can i carry out a "select distinct status_id from order_header 
order by status_id "
 via the delegator !

 thanks