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

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Oct 12 2004 - 10:39:08 EDT

  • Next message: Gentry, Michael: "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 : Tue Oct 12 2004 - 10:39:10 EDT