cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <>
Subject Re: Generating SQL from an Expression (for use in a utility method)
Date Tue, 19 May 2015 15:36:08 GMT
Hi Hugi,

Perhaps this can help you:

AggregateUtils uses AggregateTranslator to construct the SQL for a query
(getting the SQL from Cayenne) and then manipulates it to run a COUNT(*) or
SUM(...) type function based upon your original SelectQuery.  Especially
look at AggregateTranslator.createSqlString().

The example code using it might also help you:


On Tue, May 19, 2015 at 11:21 AM, Hugi Thordarson <> wrote:

> Hi all.
> I’m creating a little utility method to emulate functionality from EOF,
> i.e. to allow me to fetch distinct values for specified columns. This is
> what I have so far:
> <
> However, I would like to be able to provide an expression to the query.
> Does Cayenne have something to generate the SQL from an expression for me?
> Am I perhaps going totally wrong about this?
> Cheers,
> - hugi

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message