AW: Problem with Date/Time-part

From: René Kulschewski (KU..vu.de)
Date: Thu Mar 17 2005 - 05:10:18 EST

  • Next message: Fredrik Liden: "Query question"

    Hi,

    I haven't checked that ... But i patched Cayenne (i have send the patch to
    you) and now Cayenne handles the time portion correctly, at least in our
    environment.

    Regards
    René

    > -----Ursprüngliche Nachricht-----
    > Von: Andrus Adamchik [mailto:andru..bjectstyle.org]
    > Gesendet: Mittwoch, 16. März 2005 04:34
    > An: cayenne-use..bjectstyle.org
    > Betreff: Re: Problem with Date/Time-part
    >
    > Hi René,
    >
    > back to that old thread...
    >
    > I was testing an unrelated feature, and noticed that you
    > can't really mix #result() directives and inline column names
    > in a SQLTemplate. You have to consistently use one or the
    > other technique. Otherwise (1) Cayenne will only read a
    > subset of columns that are scripted with #result(..),
    > ignoring the rest and (2) it will read the values from
    > incorrect positions in the ResultSet (ouch!). The combination
    > of (1) and (2) can give really weird results. Maybe this is
    > what's causing your problem?
    >
    > On a side note, it is possible to detect this mismatch in the
    > code, however this requires retrieval of ResultSetMetadata
    > introducing a small delay to each query. So for now leaving
    > this up to the user to code SQLTemplate properly.
    >
    > Andrus
    >
    >
    > On Feb 25, 2005, at 4:20 AM, René Kulschewski wrote:
    >
    > >> String sqlStr = "select id, comdeviceevnmeth_id, isacknowledge,
    > > comdevice_id, "
    > >> + "#result('txdatetime'
    > >> 'java.sql.Timestamp'), "
    > >> + "#result('rxdatetime'
    > >> 'java.sql.Timestamp'), "
    > >> + "#result('gpstime'
    > > 'java.sql.Timestamp'),"
    > >> + " gpslongitude, gpslatitude, "
    > >> + "directionofmotion, velocity,
    > locationangle,
    > >> locationdescription, "
    > >> + "locationdistance,
    > > t.indata.getclobval() indata, "
    > >> + "#result('creation'
    > > 'java.sql.Timestamp'), "
    > >> + "creationby, "
    > >> + "#result('modification'
    > >> 'java.sql.Timestamp'), "
    > >> + "modificationby, isdeleted, "
    > >> + "comdeviceevnstate_id, tour_id "
    > >> + "from comdeviceevent t where
    > >> t.comdeviceevnstate_id=1"
    > >> + " order by
    > >> t.comdevice_id,t.txdatetime,t.gpstime";
    >



    This archive was generated by hypermail 2.0.0 : Thu Mar 17 2005 - 05:10:25 EST