handling of "0" dates....

From: Robert Zeigler (robert..uregumption.com)
Date: Fri Aug 03 2007 - 12:50:47 EDT

  • Next message: Kevin Menard: "Testing framework [WAS: Exceptions . . .]"

    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



    This archive was generated by hypermail 2.0.0 : Fri Aug 03 2007 - 12:51:30 EDT