Re: Dates inserted into Oracle do not have Minutes / Seconds?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Nov 28 2005 - 15:42:53 EST

  • Next message: Andrus Adamchik: "Re: [v.1.1.3 September 28 2005] Global exception."

    I don't understand why you consider this a bug. If you map it in the
    Modeler using *JDBC* DATE type, expect the time part to be lost.

    Meanings of JDBC types are well defined in the spec, independent from
    the underlying database. In other words if Oracle happens to call
    this type a "DATE", it still should be treated as TIMESTAMP on the
    JDBC end. So if you want date+time info be saved, you should be using
    TIMESTAMP in Cayenne mapping (that is based on JDBC). And you are
    free to use any compatible native database type with it.

    Andrus

    On Nov 28, 2005, at 10:35 PM, Ingo Feulner wrote:

    > Hi,
    >
    > meanwhile I "solved" this issue. Problem is, that the DBAttribute
    > mapping of a DATE Column maps to to DATE in the model, and not to
    > TIMESTAMP.
    > There is a class org.objectstyle.cayenne.access.types.UtilDateType
    > which checks the DBAttribute and converts a java.util.Date then to
    > the appropriate jdbc class.
    > But Oracle allows by default to save date + time in a DATE type, so
    > I would consider this as a bug.
    >
    > What do you think?
    >
    > Regards, Ingo.
    >
    >
    > Am 24.11.2005 um 19:55 schrieb Ingo Feulner:
    >
    >> Hi,
    >>
    >> all our inserted dates into an Oracle (10gR2) database are missing
    >> the
    >> minutes and seconds.
    >> The mapping is DB Type DATE to java.util.Date
    >> Is there a known issue (JDBC driver, NLS_LANG settings, whatever)
    >> (Haven't found one...).
    >>
    >> We're using Cayenne 1.1.3.
    >>
    >> Thanks for any help, Ingo.
    >>
    >>
    >
    >



    This archive was generated by hypermail 2.0.0 : Mon Nov 28 2005 - 15:42:56 EST