db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fox <Thomas....@seitenbau.net>
Subject groovy support in generator & typed model in templates
Date Sun, 05 May 2013 13:11:25 GMT

The groovy support in the generator is now finished.
There are 2 supported groovy template types: groovy scripts and groovy
A script returns the result string as a return value.
A template returns the text of the template files, one can use dynamic
parts in it. See http://groovy.codehaus.org/Groovy+Templates for details.
Unfortunately, the eclipse groovy plugin only supports groovy scripts, so
I'd personally rather not use the template variant.

As an example I have changed the sql generation from velocity to groovy,
using the script variant and a typed model.
Please have a look and check whether this is better to edit/understand than
the velocity templates (in my opinion, due to the typed model and editor
support, yes).
Please use the eclipse groovy plugin for viewing the cripts as it provides
conciderable value (sytax highlighting, code completion...)
A small problem is the long startup time of the groovy script engine, ca. 1
sec on my machine, but this is needed only once per generation run.

Then the decision would be whether for the templates, we want to switch
back to velocity, switch over to groovy, or leave the current status (part
groovy, part velocity)

I'll be in holiday in two days for over a week, so there is no need to


To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org

View raw message