You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Hari Plaikoil <ha...@gmail.com> on 2008/11/25 03:28:00 UTC

cannot get value from findByPrimaryCache

Hi All,

Would you like to help me, how to fetch value from a variable which its type
is GenericValue? 
this is my code:

GenericValue product = delegator.findByPrimaryKeyCache("Product",
UtilMisc.toMap("productId",productId ));

I want to get the weight's value by this code:

double weight = product.getDouble("weight").doubleValue();

but, I don't have any value store in weight's variable.

I don't know what mistakes I've done. Please help me.


Thank you
-- 
View this message in context: http://www.nabble.com/cannot-get-value-from-findByPrimaryCache-tp20674090p20674090.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: cannot get value from findByPrimaryCache

Posted by Hari Plaikoil <ha...@gmail.com>.
Thank you Charles for your help.

The problem has been solved, I didn't give much attention with the whole
process that made me stuck with that problem.

But everything is okay right now.

rgds


STELTZLEN Charles wrote:
> 
> Hi Hari,
> 
> Code seems to be ok.
> 
> Sure that the product weight you want is stored in Product ?
> 
> Don't forget to refresh your cache if you have store the product
> weight just before this reading.
> 
> 
> Hari Plaikoil a écrit :
>> Hi All,
>>
>> Would you like to help me, how to fetch value from a variable which its
>> type
>> is GenericValue? 
>> this is my code:
>>
>> GenericValue product = delegator.findByPrimaryKeyCache("Product",
>> UtilMisc.toMap("productId",productId ));
>>
>> I want to get the weight's value by this code:
>>
>> double weight = product.getDouble("weight").doubleValue();
>>
>> but, I don't have any value store in weight's variable.
>>
>> I don't know what mistakes I've done. Please help me.
>>
>>
>> Thank you
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/cannot-get-value-from-findByPrimaryCache-tp20674090p20744589.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: cannot get value from findByPrimaryCache

Posted by STELTZLEN Charles <ch...@nereide.biz>.
Hi Hari,

Code seems to be ok.

Sure that the product weight you want is stored in Product ?

Don't forget to refresh your cache if you have store the product
weight just before this reading.


Hari Plaikoil a écrit :
> Hi All,
>
> Would you like to help me, how to fetch value from a variable which its type
> is GenericValue? 
> this is my code:
>
> GenericValue product = delegator.findByPrimaryKeyCache("Product",
> UtilMisc.toMap("productId",productId ));
>
> I want to get the weight's value by this code:
>
> double weight = product.getDouble("weight").doubleValue();
>
> but, I don't have any value store in weight's variable.
>
> I don't know what mistakes I've done. Please help me.
>
>
> Thank you
>