You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by g....@telecgt.it on 2014/03/10 12:35:14 UTC

List to EntityListIterator

Hi to everyone, i’ve done the following query with the IN clause.

    List<GenericValue> XXXList = delegator.findList("XXX", null, null, null, null, false);
        
        List<GenericValue> listIt =
                 EntityUtil.filterByCondition(XXXList,
                EntityCondition.makeCondition("field",
                EntityOperator.IN, listInClause));

QUERY : select * from XXX where field IN (..,..,..,...)


now, i want to transform ‘listIt’ , to EntityListIterator. How can do that?

I need to transform it to a EntityListIterator because i’ve done a custom service, that wrap ‘performFind’ service.
So, i’ve the same OUT parameters .

Any suggestions??
Thanks

 

Re: List to EntityListIterator

Posted by Paul Piper <pp...@ilscipio.com>.
Just to be sure: You want to Iterate over the list or you are having a
problem with the clauses? 

For the former: You can either get the iterator from the List Object:

Iterator it= listIt.iterator();
while(it.hasNext()) {
   GenericValue obj = it.next();
   // Your code here

}


or you can iterate like this:

for(GenericValue obj : listIt){
   // Your code here...

}



--
View this message in context: http://ofbiz.135035.n4.nabble.com/List-GenericValue-to-EntityListIterator-tp4648975p4649710.html
Sent from the OFBiz - User mailing list archive at Nabble.com.

Re: List to EntityListIterator

Posted by Lei Wu <wu...@gmail.com>.
Using delegator.find() instead of delegator.findList() would help.


On Mon, Mar 10, 2014 at 7:35 PM, <g....@telecgt.it> wrote:

> Hi to everyone, i've done the following query with the IN clause.
>
>     List<GenericValue> XXXList = delegator.findList("XXX", null, null,
> null, null, false);
>
>         List<GenericValue> listIt =
>                  EntityUtil.filterByCondition(XXXList,
>                 EntityCondition.makeCondition("field",
>                 EntityOperator.IN, listInClause));
>
> QUERY : select * from XXX where field IN (..,..,..,...)
>
>
> now, i want to transform 'listIt' , to EntityListIterator. How can do that?
>
> I need to transform it to a EntityListIterator because i've done a custom
> service, that wrap 'performFind' service.
> So, i've the same OUT parameters .
>
> Any suggestions??
> Thanks
>
>