RE: Cayenne, Oracle and Date-based queries...

From: Julien Vignali (julien.vignal..im.hcuge.ch)
Date: Wed Oct 13 2004 - 04:40:50 EDT

  • Next message: Marcia Corprew: "RE: More Detail: NullPointerException in call to DataContext.crea teDataContext()"

    Thanks Andrus, Mike and Michael.
    Now it works fine...
     

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: Tuesday, October 12, 2004 4:39 PM
    To: cayenne-use..bjectstyle.org
    Subject: Re: Cayenne, Oracle and Date-based queries...

    Hi Julien,

    To my knowledge JDBC driver takes a good care of the date conversions if a
    corresonding column is mapped as the right JDBC date/time type. Could you
    try mapping DbAttribute "patients.birthdt" as DATE and not TIMESTAMP or
    TIME?

    Andrus

    > Hello everybody,
    > I recently switched to Cayenne for our medical query application on a
    > Oracle 9i DB, so my Cayenne's knowledge is still limited. So far,
    > everything is working great and smoothly except when it comes
    > date-based queries.
    >
    > For example :
    >
    > // doesn't work (i.e. no rows returned) SELECT t0.patientsname FROM
    > imagedev.patients t0 WHERE (t0.birthdt =
    > '1953-05-31')
    >
    > // works (x rows returned)
    > SELECT t0.patientsname FROM imagedev.patients t0 WHERE (t0.birthdt =
    > TO_DATE('1953-05-31','YYYY-MM-DD'))
    >
    >
    > Is there a way to add some oracle SQL functions such as "TO_DATE()" in
    > an Qualifier or should I use SQLTemplate instead since it is db
    > vendor-dependant functionality ? Does Cayenne can be aware of the
    > NLS_PARAMETERS and use them ?
    >
    > Thanks :-)
    > Julien



    This archive was generated by hypermail 2.0.0 : Wed Oct 13 2004 - 04:41:06 EDT