Dev - auto-convert BigDecimal to Double in GenericEntity?

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

Dev - auto-convert BigDecimal to Double in GenericEntity?

Si Chen-2
Hi.  I am getting these error messages:
194878 (http-0.0.0.0-8443-Processor2) [      
GenericEntity.java:393:ERROR] In entity field set the value passed in
[java.math.BigDecimal] is not compatible with the Java type of the field
[Double]

Might it be nice to modify GenericEntity.java so that BigDecimal is
automatically converted, instead of doing the
new Double(value.doubleValue())
every time?

Si
 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Dev - auto-convert BigDecimal to Double in GenericEntity?

David E. Jones

For now I would highly recommend that the BigDecimal is _not_ converted to a Double. Just pass it in and ignore the log message.

I'm changing the log message to a warning instead of an error, but either way until we get to the point of changing some of these currency things to be BigDecimal underneath (ie in the fieldtypes*.xml files) then we should just ignore the warning message.

-David


Si Chen wrote:

> Hi.  I am getting these error messages:
> 194878 (http-0.0.0.0-8443-Processor2) [      
> GenericEntity.java:393:ERROR] In entity field set the value passed in
> [java.math.BigDecimal] is not compatible with the Java type of the field
> [Double]
>
> Might it be nice to modify GenericEntity.java so that BigDecimal is
> automatically converted, instead of doing the
> new Double(value.doubleValue())
> every time?
>
> Si
>  
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/dev
 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Dev - auto-convert BigDecimal to Double in GenericEntity?

Si Chen-2
Ok great.  I just saw the ERROR and thought it was a bad thing which had to be fixed.

David E. Jones wrote:
For now I would highly recommend that the BigDecimal is _not_ converted to a Double. Just pass it in and ignore the log message.

I'm changing the log message to a warning instead of an error, but either way until we get to the point of changing some of these currency things to be BigDecimal underneath (ie in the fieldtypes*.xml files) then we should just ignore the warning message.

-David


Si Chen wrote:
  
Hi.  I am getting these error messages:
194878 (http-0.0.0.0-8443-Processor2) [      
GenericEntity.java:393:ERROR] In entity field set the value passed in 
[java.math.BigDecimal] is not compatible with the Java type of the field 
[Double]

Might it be nice to modify GenericEntity.java so that BigDecimal is 
automatically converted, instead of doing the
new Double(value.doubleValue())
every time? 

Si
 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
    
 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev

  

 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Dev - auto-convert BigDecimal to Double in GenericEntity?

Adam Heath-2
In reply to this post by Si Chen-2
On Mon, 20 Mar 2006, Si Chen wrote:

> Hi.  I am getting these error messages:
> 194878 (http-0.0.0.0-8443-Processor2) [
> GenericEntity.java:393:ERROR] In entity field set the value passed in
> [java.math.BigDecimal] is not compatible with the Java type of the field
> [Double]
>
> Might it be nice to modify GenericEntity.java so that BigDecimal is
> automatically converted, instead of doing the
> new Double(value.doubleValue())
> every time?

A better way would be to have a generic conversion(up and down) for all such
types.  String to Number, Boolean to String(for indicator types), etc.
 
_______________________________________________
Dev mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: Dev - auto-convert BigDecimal to Double in GenericEntity?

Edison
In reply to this post by Si Chen-2
For this season, that bag mens watches is the Michael Kors Astor Huge Satchel. This satchel designer handbags is ultra chic and has just the appropriate quantity of rocker-chick vibe with it rolex watches is stud detailing on soft calf-skin leather. No matter whether this bag will stand the test of time,bags facts I don't hermes wallet know, but for beneath $300, it really is definitely a good catch for chanel j12 a bag from a top-notch designer and one particular I'll be reaching for on numerous gucci watches occasions. Invest in by way of ampmfashion.com for $249. Christmas is just around the corner — you are wondering what you can get as a miu miu gift for her. You should try a Purseket Purse Organizer (available at their website, www.Purseket.com)?If you don’t hublot know what a removable purse organizer is, let me explain… Think of the handbag organizer from Purseket as a brand new insides for your handbag. It’s a removable panel of compartments that you can insert into your purse which will give your purse many more pockets inside to facilitate keeping your prada possessions organized. It’s just one of those simple but effective products.