cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Show the SQL that will be generated by an EJBQLQuery?
Date Tue, 16 Aug 2016 15:49:40 GMT
EJBQL translation goes through a phase of creating a SQLTemplate, which is essentially SQL
with embedded Velocity directives. Then SQLTemplate is executed against the DB. All this happens
inside EJBQLAction [1]. So perhaps you can copy some of this code and put it in your unit
test and analyze SQLTemplate contents? 

The only "context" you will need is DataNode. It is available via injection inside any test
that inherits from ServerCase:

protected DataNode node;



> On Aug 16, 2016, at 6:36 PM, Hugi Thordarson <> wrote:
> Hi all,
> since I want to try to do a little work on EJBQL in Cayenne; is there any way for me
to generate and look at the SQL that will be generated by an EJBQLQuery without actually submitting
it to the DB?
> Cheers,
> - hugi
> // Hugi Thordarson
> //
> // s. 895-6688

View raw message