Re: [ cayenne-Bugs-803355 ] Import EOModel: wrong default for NSCalendarDate/NSTimestamp

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sun Sep 14 2003 - 12:43:41 EDT

  • Next message: Andrus Adamchik: "[Fixed] issues reported by Mike"

    On Wednesday, September 10, 2003, at 09:16 AM, Mike Kienenberger wrote:
    >>
    >> This is fixed, so NSCalendarDate is imported as
    >> java.sql.Timestamp at the ObjAttribute level and TIMESTAMP
    >> at the DbAttribute level.
    >
    > So should this be changed to a java.util.Date rather than a
    > java.sql.Timestamp?
    > I'd be more comfortable with a Date.

    I agree that java.util.Date would be a more consistent default. I am
    not fixing it now though, since there is a bigger issue of picking the
    right database type based on database-specific types stored in EOModel.
    Right now DB column type is derived from Java Class. This works OK in
    most cases but is not correct in principle.

    When we address this bigger issue, Date vs. Timestamp will be resolved
    by itself.

    > I'm also concerned with TIMESTAMP -- all of my EOModels generated
    > Oracle
    > DATE external types. is a DbAttribute TIMESTAMP going to generate the
    > same
    > thing? I seem to recall that an Oracle TIMESTAMP has a much greater
    > precision than a DATE (to the nanosecond).
    >
    > I really don't know the answers to these questions or even if there's
    > reason
    > for concern.

    TIMESTAMP is not a problem. Cayenne only uses the types defined in
    java.sql.Types (per JDBC standard), it is up to the driver to do the
    needed conversions to the target DB type. TIMESTAMP maps just fine to
    Oracle DATE.

    Andrus



    This archive was generated by hypermail 2.0.0 : Sun Sep 14 2003 - 12:39:42 EDT