OK, I'll try to build  turbine 2.3.1-dev. I 'm just afraid it may be instable 
for a production environment.

As regards the "torque problem" I mentioned, it has probably been thought of 
before by Torque designers : a defaultJavaType="object" and a 
javaType="object" can be specified respectively at a database level or column 
level in the database schema.

-- 
Lo�c QUERAN


Subject: Re: Intake unrequired primitive types and Torque
Date: Tue, 30 Dec 2003 10:00:12 +1100
From: Scott Eade <[EMAIL PROTECTED]>
To: Turbine Users List <[EMAIL PROTECTED]>

There are a number for intake fixes in cvs.  Can you build
turbine 2.3.1-dev and see if your problems still occur?

Scott

--
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au

Lo�c Qu�ran wrote:
>It seems  that intake 2.3 forms with unrequired int fields can't be
>successfully submitted unless one fills in the field. A blank error message
>appears if no value is provided.
>
>The problem lies in the IntegerValidator.assertValidity method. A condition
>if ((required || minLength > 0) || (testValue != null && testValue.length()
> > 0))
>{
> ...
>}
>should be added before an attempt to Integer.parseInt is carried out. Since
>this condition is not implemented, a "" int value will lead to a
>ValidationException with a most often null "invalidNumberMessage".
>
>Once this correction is written, another problem appears :
>group.setProperties(myObject) raises an exception. The problem is that a
>dynamic invocation of myObject.setMyInt(null) is tried in the
>Field.setProperty(Object obj) method.
>
>Probably, this problem also appears with any primitive type (int, float,
>double, short, long). For a non primitive type, a null value means no value.
>How can this be achieved with primitive types ?
>
>To correct the problem, a private String type field can be added in the
> Field class, initialized from XmlField.getType() in the Field constructor
> and a if ((!type.equals("int")) || (valArray[0] != null))
>{
>       setter.invoke(obj, valArray);
>}
>condition can be added.
>
>With these corrections, everything seems to work properly. Objects with
>unrequired int fields can be retrieved with intake. They can be saved by
>Torque ... but unfortunately, Torque inserts a 0 value (at least on MySQL)
>instead of a NULL  value for unrequired unfilled int fields ! I guess this
> is a problem for referential integrity.
>
>Any idea on how this Torque problem could be fixed ?

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to