On Friday, August 31, 2012 9:57:57 AM UTC+2, Lukas Eder wrote:
>
> - Neither jOOQ-meta nor jOOQ-codegen are "stable" APIs. This means
> that unlike the jOOQ core, I do not officially support them and keep
> them backwards-compatible. For jOOQ 3.0, they can be heavily changed
> if you find some issues to be disturbing. Specifically, their
> inter-dependency is probably an annoying issue for a bigger
> refactoring.
>
I used a custom generator for renaming generated objects as some of my DB
tables have prefix and pluralization that were repercussed. However I was
surprised that I couldn't find a nice and easy way to do this, also on the
documentation side, there isn't much regarding the Definition object that
gets passed to your overriden methods..
I thought an easier way to solve this issue(which is probably a common one)
would be to use an XML file like this
<table dbName="Authors">
<tableClass>TAuthor</tableClass>
<tableStaticField>T_AUTHOR</tableStaticField>
<recordClass name="AuthorRecord" >
<column name="ID_AUTHOR" fieldName="idAuthor" getter=".."
setter="..."/>
<column name="..."/>...
</recordClass>
</table>
(or perhaps a syntax closer to... mybatis-generator... don't misunderstand,
no offense here, I am not pretending they do everything so much better, but
a couple of ideas they had are perhaps worth a look, right?)
You would pass its path to a custom generator class using an environment
variable or java system properties from the command line and have it do the
necessary overrides.
I was even thinking about contributing such a functionality depending on my
free time but it's probably not a good idea if you are going to redesign
the generator API in v3.
Best