Personally, my preference is to fix the underlying data .. and convert those 
0000-00-00 values to NULL in the db.
Save the special-case handling in the event that you *can't* cleanup the source 
data .. for whatever reason.
(Is that what you mean?)
-mk

 
On Friday, August 03, 2007, at 12:54PM, "Robert Zeigler" <[EMAIL PROTECTED]> 
wrote:
>I'm sitting here migrating a set of data generated from a php  
>application, stored in mysql.
>One of the oddities of the data is that there is a particular date  
>field with a lot of 0's...
>THe field allows null, but apparently, the way that the php app was  
>built, when this date
>was unspecified, it was inserted as 0's for all fields in the date,  
>rather than as null.
>That apparently poses a problem for jdbc (unable to convert  
>'0000-00-00 00:00:00' to java.util.Date;
>which is reasonable since 0 doesn't correspond to any month...).  Of  
>course, it's a simple matter for
>me to run into the database and convert all "0" dates to NULL.  But I  
>was contemplating whether it would
>be worth special casing this in cayenne, to detect the "0" dates and  
>convert them to null...
>I suspect probably not... but I figured I'd throw the thought out  
>there for comment.
>
>Robert
>
>

Reply via email to