Hi Adena,
The standard way is to use the class version of the primitive i.e. instead
of int use Integer. You can then check if the value was set by
(fld1==null). And the jdbc code for inserting a null value is easy and
handled by the driver and not your code used to implement you own standard.
Note that with your own standard i.e. -1 you have to be careful about making
sure this value is not within the value range for now and the future and
that your finder methods take this into account; also not to mentioning the
documentation of this standard.
William Louth
Inprise
www.inprise.com
-----Original Message-----
From: A mailing list for Enterprise JavaBeans development
[mailto:[EMAIL PROTECTED]]On Behalf Of Adena Galinsky
Sent: Monday, August 28, 2000 8:49 AM
To: [EMAIL PROTECTED]
Subject: null values in primitive fields
Some of our optional fields are represented as primitive types (int, long
etc) in our entity beans and in the (Oracle) database.
What is the standard way of indicating that the value was left blank? We
have created our own standard (-1 = null), but if there's a standard way to
handle this, we'd like to change it.
thanks,
Adena
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".