Re: svn commit: r959470 - in /ofbiz/trunk/framework/entity: dtd/ entitydef/ fieldtype/ src/org/ofbiz/entity/jdbc/ src/org/ofbiz/entity/model/ src/org/ofbiz/entity/test/

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

Re: svn commit: r959470 - in /ofbiz/trunk/framework/entity: dtd/ entitydef/ fieldtype/ src/org/ofbiz/entity/jdbc/ src/org/ofbiz/entity/model/ src/org/ofbiz/entity/test/

Matthieu Bollot-4
Le mercredi 30 juin 2010 à 23:27 +0000, [hidden email] a écrit :
> Author: adrianc
> Date: Wed Jun 30 23:27:24 2010
> New Revision: 959470
>
> URL: http://svn.apache.org/viewvc?rev=959470&view=rev
> Log:
> Some work on the entity engine:
>
> 1. Removed the conversion framework from the entity engine. Type conversions should be done higher up in the stack. The basic pattern is the same, but instead of each ModelFieldType containing a converter instance, it now contains a JdbcValueHandler instance. The JdbcValueHandler performs the same task as the original switch statement - in effect each ModelFieldType contains its own piece of the switch statement.
../..
> This has been tested on Advantage, Derby, and MySQL. It should be completely backward compatible. I will be monitoring the dev mailing list closely for any problems.

Hi,
I think I've found a problem, seeable in createCalendarExceptionDay
service.

When launched, I've got an error :
Error in Service [createCalendarExceptionDay]: Error running the simple-method: Error in simple-method operation [<if-not-empty field-name="newEntity.calendarId" map-name=""/>]: java.lang.RuntimeException: Error in simple-method operation [<create-value/>]: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Double<br/>null

I've seen a patch from hans type="Double" instead of BigDecimal but in
createCalendarExceptionDay, <create-value value-field="newEntity"
type="Double"/> does not work.

I think that this will not be the only one error related to convert from
BigDecimal to Double, and I thought that everything should be BigDecimal
instead of Double… so is there something more "global" to do ?

tell me if I can help.

PS : you could see the error using the selenium here :
http://selenium.neogia.org/ofbiz/tests/ManufacturingCreateCalendarAndWeek.html


--
Matthieu BOLLOT
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r959470 - in /ofbiz/trunk/framework/entity: dtd/ entitydef/ fieldtype/ src/org/ofbiz/entity/jdbc/ src/org/ofbiz/entity/model/ src/org/ofbiz/entity/test/

Adrian Crum
Matthieu,

The correct Java data type must be sent to the entity engine -
conversions are not supported any more. That was the original behavior.

The entity engine automated tests test the field data types. If those
tests pass on your installation, then the error you are encountering is
not due to this commit.

You can perform a data type conversion in mini-language by using the
<set> element and specifying the target data type:

<set field="doubleValue" from-field="bigDecimalValue" type="Double"/>

-Adrian

On 7/12/2010 7:29 AM, Matthieu Bollot wrote:

> Le mercredi 30 juin 2010 à 23:27 +0000, [hidden email] a écrit :
>> Author: adrianc
>> Date: Wed Jun 30 23:27:24 2010
>> New Revision: 959470
>>
>> URL: http://svn.apache.org/viewvc?rev=959470&view=rev
>> Log:
>> Some work on the entity engine:
>>
>> 1. Removed the conversion framework from the entity engine. Type conversions should be done higher up in the stack. The basic pattern is the same, but instead of each ModelFieldType containing a converter instance, it now contains a JdbcValueHandler instance. The JdbcValueHandler performs the same task as the original switch statement - in effect each ModelFieldType contains its own piece of the switch statement.
> ../..
>> This has been tested on Advantage, Derby, and MySQL. It should be completely backward compatible. I will be monitoring the dev mailing list closely for any problems.
>
> Hi,
> I think I've found a problem, seeable in createCalendarExceptionDay
> service.
>
> When launched, I've got an error :
> Error in Service [createCalendarExceptionDay]: Error running the simple-method: Error in simple-method operation [<if-not-empty field-name="newEntity.calendarId" map-name=""/>]: java.lang.RuntimeException: Error in simple-method operation [<create-value/>]: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Double<br/>null
>
> I've seen a patch from hans type="Double" instead of BigDecimal but in
> createCalendarExceptionDay,<create-value value-field="newEntity"
> type="Double"/>  does not work.
>
> I think that this will not be the only one error related to convert from
> BigDecimal to Double, and I thought that everything should be BigDecimal
> instead of Double… so is there something more "global" to do ?
>
> tell me if I can help.
>
> PS : you could see the error using the selenium here :
> http://selenium.neogia.org/ofbiz/tests/ManufacturingCreateCalendarAndWeek.html
>
>
Reply | Threaded
Open this post in threaded view
|

Correct way to convert was svn commit: r959470 - in /ofbiz/trunk/framework/entity: dtd/ entitydef/ fieldtype/ src/org/ofbiz/entity/jdbc/ src/org/ofbiz/entity/model/ src/org/ofbiz/entity/test/

BJ Freeman
maybe add this to:

http://ofbiz.apache.org/docs/entity.html
https://cwiki.apache.org/confluence/display/OFBIZ/Mini-Language+Guide

https://cwiki.apache.org/confluence/display/OFBIZ/FAQ+-+Tips+-+Tricks+-+Cookbook+-+HowTo

Adrian Crum sent the following on 7/12/2010 7:52 AM:

> Matthieu,
>
> The correct Java data type must be sent to the entity engine -
> conversions are not supported any more. That was the original behavior.
>
> The entity engine automated tests test the field data types. If those
> tests pass on your installation, then the error you are encountering is
> not due to this commit.
>
> You can perform a data type conversion in mini-language by using the
> <set> element and specifying the target data type:
>
> <set field="doubleValue" from-field="bigDecimalValue" type="Double"/>
>
> -Adrian
>
> On 7/12/2010 7:29 AM, Matthieu Bollot wrote:
>> Le mercredi 30 juin 2010 à 23:27 +0000, [hidden email] a écrit :
>>> Author: adrianc
>>> Date: Wed Jun 30 23:27:24 2010
>>> New Revision: 959470
>>>
>>> URL: http://svn.apache.org/viewvc?rev=959470&view=rev
>>> Log:
>>> Some work on the entity engine:
>>>
>>> 1. Removed the conversion framework from the entity engine. Type
>>> conversions should be done higher up in the stack. The basic pattern
>>> is the same, but instead of each ModelFieldType containing a
>>> converter instance, it now contains a JdbcValueHandler instance. The
>>> JdbcValueHandler performs the same task as the original switch
>>> statement - in effect each ModelFieldType contains its own piece of
>>> the switch statement.
>> ../..
>>> This has been tested on Advantage, Derby, and MySQL. It should be
>>> completely backward compatible. I will be monitoring the dev mailing
>>> list closely for any problems.
>>
>> Hi,
>> I think I've found a problem, seeable in createCalendarExceptionDay
>> service.
>>
>> When launched, I've got an error :
>> Error in Service [createCalendarExceptionDay]: Error running the
>> simple-method: Error in simple-method operation [<if-not-empty
>> field-name="newEntity.calendarId" map-name=""/>]:
>> java.lang.RuntimeException: Error in simple-method operation
>> [<create-value/>]: java.lang.ClassCastException: java.math.BigDecimal
>> cannot be cast to java.lang.Double<br/>null
>>
>> I've seen a patch from hans type="Double" instead of BigDecimal but in
>> createCalendarExceptionDay,<create-value value-field="newEntity"
>> type="Double"/> does not work.
>>
>> I think that this will not be the only one error related to convert from
>> BigDecimal to Double, and I thought that everything should be BigDecimal
>> instead of Double… so is there something more "global" to do ?
>>
>> tell me if I can help.
>>
>> PS : you could see the error using the selenium here :
>> http://selenium.neogia.org/ofbiz/tests/ManufacturingCreateCalendarAndWeek.html
>>
>>
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r959470 - in /ofbiz/trunk/framework/entity: dtd/ entitydef/ fieldtype/ src/org/ofbiz/entity/jdbc/ src/org/ofbiz/entity/model/ src/org/ofbiz/entity/test/

Matthieu Bollot-4
In reply to this post by Adrian Crum
Le lundi 12 juillet 2010 à 07:52 -0700, Adrian Crum a écrit :

> Matthieu,
>
> The correct Java data type must be sent to the entity engine -
> conversions are not supported any more. That was the original behavior.
>
> The entity engine automated tests test the field data types. If those
> tests pass on your installation, then the error you are encountering is
> not due to this commit.
>
> You can perform a data type conversion in mini-language by using the
> <set> element and specifying the target data type:
>
> <set field="doubleValue" from-field="bigDecimalValue" type="Double"/>

Hi,
I've created a jira (3859) with a patch, could you tell me what do you
think about it ?

thx


--
Matthieu BOLLOT
www.nereide.biz