Dev - Warning: typecasting set .. ${bsh: ..} in minilang

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

Dev - Warning: typecasting set .. ${bsh: ..} in minilang

Si Chen-2
Hi everybody -

Just realized something today.  If you do the following in minilang:

                    <set field="notApplied" value="${bsh:org.ofbiz.accounting.invoice.InvoiceWorker.getInvoiceNotApplied(invoice)}"/>

(which I did), you MUST add a:
type="Double"

Otherwise, the result is cast as a String, and your field becomes a
String as well.  This is OK in minilang, but some databases like
PostgreSQL will *not* accept it as a NUMERIC.

Thought this might be something we should all be careful with.

Si

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