On Postgres it's not only a warning but really an error. The transaction is rolled back and you can't create an order from eCommerce
without that change.
I used Double since that's what was used 3 lines above for the same variable.
I just tried with BigDecimal, it works too. But I'm not sure it makes more sense to use BigDecimal as it's about a quantity
(totalQuantityOrdered).
I never saw a rational quantity used but I guess Long would not fit well here in case somebody would have the need for rational
quantities.
Do you want I put BigDecimal instead ?
Jacques
From: "David E Jones" <[email protected]>
That's a funny one, since the syntax used was not supported before UEL was introduced, and I mean the original line without your
change Jacques. In other words this attribute would not work without UEL:
value="${productCalculatedInfo.totalQuantityOrdered + parameters.quantity}"
I guess somehow the type casting was missed so whatever UEL defaults to was used. If that was BigDecimal, then we should LEAVE it
as BigDecimal and not cast it to a Double. Yes, for now there will be warnings (which is all that the reported message was), but
there is a separate branch that mostly Scott Gray is working on to get everything moved over from Double to BigDecimal, and
until then the warnings are a good thing and we shouldn't try to fix each one.
For everyone, when you see that warning message just consider a reminder that there is an effort going on to move from Double to
BigDecimal and without it there are issues in OFBiz, so your help on the effort will help you too.
-David
On Dec 16, 2008, at 11:21 AM, Jacques Le Roux wrote:
I got the same type of problem in OrderServices.createOrder method when
calling service countProductQuantityOrdered
I changed the line
<set field="productCalculatedInfo.totalQuantityOrdered" value="$ {productCalculatedInfo.totalQuantityOrdered +
parameters.quantity}"/>
to
<set field="productCalculatedInfo.totalQuantityOrdered" value="$ {productCalculatedInfo.totalQuantityOrdered +
parameters.quantity}"
type="Double"/>
I guess it's related to recent UEL change and, as David said, we will cross a
lot of same issues...
Jacques
From: "Akash Jain" <[email protected]>
Hello all,
I am getting an exception when I submitted order in ecommerce.
(1) First I add a product to cart.(add to cart)
(2) Then click on checkout.(One Page Checkout)
I am getting an exception like
DATABASE TYPE error IN GenericEntity.set In entity field
[OrderPaymentPreference.maxAmount] set the value passed in
[java.math.BigDecimal] is not compatible with the Java type of the field
[Double]
after submitting order.(Submit Order)
( I am working on 726678 Revision)
Thanks in advance
Regards
Akash Jain
Hotwaxmedia Pvt. Ltd.