Re: Complex SELECT request error

From: Steve Troudart (stroudar..ekano.fr)
Date: Wed Jan 02 2008 - 10:03:06 EST

  • Next message: Andrus Adamchik: "Re: Logging changes?"

    Perfect !!!

    Thanks for your help

    Le 2 janv. 08 à 15:49, Andrus Adamchik a écrit :

    > Hi Steve,
    >
    > Looks like you need to call SQLTemplate.setFetchingDataRows(true)
    >
    > Andrus
    >
    > On Jan 2, 2008, at 4:30 PM, Steve Troudart wrote:
    >
    >> Hello, (and Happy new year)
    >> I'm new to Cayenne.
    >> I have to use some raw SQL in a part of my application.
    >> In WebObjects i used the EOUtilies.rawrowsforSQL method.
    >>
    >> In Cayenne, there is the SQLTemplate to use raw SQL but it seems
    >> that it doesn't work well on complex SQL requests.
    >>
    >> I tried a SELECT command like :
    >> SELECT... FROM (SELECT .... FROM (SELECT ... FROM TABLE))
    >> and there is a problem.
    >> The DataObject does not retrieve his ID (it's normal because it's
    >> not possible to map it) but the DataRow seems to be correct).
    >>
    >> Is it possible to have a collection of DataRows in an HashMap,
    >> instead of a collection of DataObjects?
    >>
    >> I made a SQL request so you can see what i'm saying.
    >>
    >>
    >> SELECT DISTINCT a.idtable newidTable, idColumn FROM TABLE a
    >>
    >> Null value for 'IDTABLE'. Snapshot:
    >> org.apache.cayenne.DataRo..48081[values={IDCOLUMN=86008,
    >> NEWIDTABLE=9687}, version=-9223372036854775807,
    >> replaces=-9223372036854775808]. Prefix: null
    >>
    >> Thanks for your help
    >> Steve.
    >>
    >>
    >



    This archive was generated by hypermail 2.0.0 : Wed Jan 02 2008 - 10:03:38 EST