db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Carl <patrick.c...@web.de>
Subject Re: Question: Torque NULL handling on insert, update
Date Mon, 29 Oct 2007 07:00:19 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



brycenesbitt schrieb:
> Can anyone point me to documentation on what to expect for handling of null
> fields.  For foreign key references, I'm having no trouble.  But I have an
> int and a long field that set switched from null to 0.  I'd like to find a
> way to keep them null.   I do specify:
> 
> <column name="RESERVATION_ID"  type="INTEGER" required="false"
> default="null"/>
> 
> So the column is both not required, and for good measure defaults to null. 
> But I don't see corresponding torque code to recognize null as a legitimate
> value.

What you find here is the Java default behaviour. A int has a default
value of 0. It can not be set to null. Therefore when the value is
initialized and no other value is given it is set to 0. Same applies to
long.

Patrick

- --
Patrick Carl
mailto:patrick@carl.it                                http://carl.it
GnuPG-Fingerprint: 3599 02CF 0419 BCA6 6BAC 4B53 DB7C 1897 451C F498
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)

iD8DBQFHJYUD23wYl0Uc9JgRAloVAJ9Wz6oXNvRdli/9os87Rd9p8i35jQCgsXsQ
XLtf//nqKcOKmyhMDA+Mi48=
=cev8
-----END PGP SIGNATURE-----

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


Mime
View raw message