You better map it to Integer, while not int, and check NULL by yourself. We checked Castor source code, there is some code commented out in ClassMolder which was intended to put default value for different primitive types if it is null. Later we found the business rule really is very different for each primitive type default value in different context. '0' may not always be good for int null.
So you better check null yourself and put a reasonable default value in your java class. Regards ------------ Zhongling "Alex" Li -----Original Message----- From: marie sauvaud [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 16, 2001 12:57 AM To: [EMAIL PROTECTED] Subject: Re: [castor-dev] How Castor map null into an int An Address contains a PostalCode that can be null in the database but is mapped to a int in Java. If the field is null in the database, a NullPointerException is thrown when I try to retrieve the address. Does someone know why? Marie. ___________________________________________________________ Un nouveau Nokia Game commence. Allez sur http://fr.yahoo.com/nokiagame avant le 3 novembre pour participer � cette aventure tous m�dias. ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
