Re: select field with function

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Mar 03 2006 - 06:59:47 EST

  • Next message: Cris Daniluk: "object binding"

    Hi Davide,

    you can create a SQLTemplate (aka "raw SQL" query in the Modeler). If
    you are curious about the format it looks something like that:

    <query name="UntitledQuery"
    factory="org.objectstyle.cayenne.map.SQLTemplateBuilder" root="data-
    map" root-name="UntitledDomainMap">
            <property name="cayenne.GenericSelectQuery.fetchingDataRows"
    value="true"/>
            <sql><![CDATA[SELECT * FROM X]]></sql>
    </query>

    Andrus

    On Mar 3, 2006, at 1:51 PM, Pirola Davide wrote:

    > Hi,
    > i have a little bit complex query:
    >
    > SELECT NAME, COUNT(*), sum(PRICE) FROM MYTABLE WHERE DATEDIFF
    > ('dd',CREATION_TIME, now()) < 10 GROUP BY NAME
    >
    > How i can configure this query in a datamap.xml file?
    >
    > I can use the "<qualifier>" tag for the WHERE part of the query...
    > but for the GROUP BY and the SELECT field what i can use?
    >
    >
    > Thank's
    > Davide



    This archive was generated by hypermail 2.0.0 : Fri Mar 03 2006 - 06:59:50 EST