You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by Tobias Hilka <th...@vps.de> on 2007/01/05 18:15:47 UTC

Problems executing BasePeer.doUpdate(Criteria, Criteria, Connection)

Hello everyone,

We are having trouble executing the doUpdate(Criteria, Criteria, Connection)
method from BasePeer. The update we want to perform is changing the value of
a field of type BOOLEANINT and we use a Boolean object to express the new
state of the object in the update Criteria, we get an error conserning the
value we want to insert in the table.

We tried it both, for MSSQL Server and Oracle, and each time we got an error
message.

For MSSQL:
org.apache.torque.TorqueException: com.workingdogs.village.DataSetException:
Bad conversion: java.lang.NumberFormatException: For input string: "false"
	at
org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:109)
	at
org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:635)
	at org.apache.torque.util.BasePeer.access$000(BasePeer.java:79)
	at org.apache.torque.util.BasePeer$4.process(BasePeer.java:1220)
	at org.apache.torque.util.BasePeer.processTables(BasePeer.java:1736)
	at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1215)


For Oracle:
Don't have the exact message any more, but something like: Update to null
not possible.


Debugging this problem I found that there is a doUpdate(Criteria,
Connection) method for each BasePeer. Therein the method
correctBooleans(criteria) is called which replaces Boolean.TRUE to
Integer(1) and Boolean.FALSE to Integer(0). I can not find this call in the
BasePeer.doUpdate(Criteria, Criteria, Connection) method.

Could it be that this call is missing there or is there any other treatment
of this problem there?

Thank you for your help.

Have a nice weekend.

Tobias

Antwort: Problems executing BasePeer.doUpdate(Criteria, Criteria, Connection)

Posted by Thomas Fischer <fi...@seitenbau.net>.
If I remember correctly, the doUpdate(Criteria, Criteria, Connection)
method expects booleanints and booleancher being already converted to
Integer and Char. Have you tried using a new Integer(1) for true or a new
Integer(0) for false, respectively ?

     Thomas

"Tobias Hilka" <th...@vps.de> schrieb am 05.01.2007 18:15:47:

> Hello everyone,
>
> We are having trouble executing the doUpdate(Criteria, Criteria,
Connection)
> method from BasePeer. The update we want to perform is changing the value
of
> a field of type BOOLEANINT and we use a Boolean object to express the new
> state of the object in the update Criteria, we get an error conserning
the
> value we want to insert in the table.
>
> We tried it both, for MSSQL Server and Oracle, and each time we got an
error
> message.
>
> For MSSQL:
> org.apache.torque.TorqueException:
com.workingdogs.village.DataSetException:
> Bad conversion: java.lang.NumberFormatException: For input string:
"false"
>    at
> org.apache.torque.util.BasePeer.throwTorqueException(BasePeer.java:109)
>    at
> org.apache.torque.util.BasePeer.insertOrUpdateRecord(BasePeer.java:635)
>    at org.apache.torque.util.BasePeer.access$000(BasePeer.java:79)
>    at org.apache.torque.util.BasePeer$4.process(BasePeer.java:1220)
>    at org.apache.torque.util.BasePeer.processTables(BasePeer.java:1736)
>    at org.apache.torque.util.BasePeer.doUpdate(BasePeer.java:1215)
>
>
> For Oracle:
> Don't have the exact message any more, but something like: Update to null
> not possible.
>
>
> Debugging this problem I found that there is a doUpdate(Criteria,
> Connection) method for each BasePeer. Therein the method
> correctBooleans(criteria) is called which replaces Boolean.TRUE to
> Integer(1) and Boolean.FALSE to Integer(0). I can not find this call in
the
> BasePeer.doUpdate(Criteria, Criteria, Connection) method.
>
> Could it be that this call is missing there or is there any other
treatment
> of this problem there?
>
> Thank you for your help.
>
> Have a nice weekend.
>
> Tobias


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org