How to fetch the data from table?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to fetch the data from table?

dhilip kumar
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.
Reply | Threaded
Open this post in threaded view
|

Re: How to fetch the data from table?

cjhowe
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 <[hidden email]> 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.