Re: Complex SELECT request error

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Jan 02 2008 - 09:49:39 EST

  • Next message: Kevin Menard (JIRA): "[JIRA] Commented: (CAY-697) Deleting objects in ROP does not seem to delete the object in context linked arrays"

    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 - 09:50:13 EST