You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by dhilip kumar <dh...@yahoo.co.in> on 2006/09/05 08:25:50 UTC

How to fetch the data from table?

I am trying to fetch the products from the "productCategoryMember" table having the "sequenceNum" I specify.
I am using the following line to fetch data.
  productCategoryMembers = productCategory.getRelatedCache("ProductCategoryMember", null, UtilMisc.toList("sequenceNum"));
  Could I please get some idea on this.
   
  Thanks

 		
---------------------------------
Do you Yahoo!?
 Everyone is raving about the  all-new Yahoo! Mail.

Re: How to fetch the data from table?

Posted by Chris Howe <cj...@yahoo.com>.
the sequenceNum you specify???
GenericValue.getRelatedCache(relationName,
byAndFields, orderBy) is what you're running

your routine is specifying to simply sort the related
values by sequenceNum

what you want is:
sequnceNum = yourSequenceNum;
productCategoryMembers =
productCategory.getRelatedCache("ProductCategoryMember",
UtilMisc.toMap("sequnceNum", sequnceNum), null);

or 

productCategory.getRelatedByAndCache("ProductCategoryMember",
UtilMisc.toMap("sequnceNum", sequnceNum));


--- dhilip kumar <dh...@yahoo.co.in> wrote:

> I am trying to fetch the products from the
> "productCategoryMember" table having the
> "sequenceNum" I specify.
> I am using the following line to fetch data.
>   productCategoryMembers =
>
productCategory.getRelatedCache("ProductCategoryMember",
> null, UtilMisc.toList("sequenceNum"));
>   Could I please get some idea on this.
>    
>   Thanks
> 
>  		
> ---------------------------------
> Do you Yahoo!?
>  Everyone is raving about the  all-new Yahoo! Mail.