> 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..
There would be a way using the generator strategy, but it isn't nicely documented (or even well-designed) > I thought an easier way to solve this issue(which is probably a common one) > would be to use an XML file like this > > [...] Yes, the intermediate XML step would also be my favourite. In fact, the solution I'm looking for would involve two code-generators: 1. A generator to generate this XML from a physical database schema 2. A generator to generate Java classes from this XML Users may then choose whether they really need step 1. Also, they may use XSL transformation (or any other means) to transform the XML meta-data into any other format, including - for instance - Hibernate's hbm.xml format (or the other way round). > (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?) No offense taken. I had been exploring this topic earlier this year. Ideally, I'd like to have an XML schema modelling the SQL standard INFORMATION_SCHEMA: http://stackoverflow.com/q/8184849/521799 But any other model may do as well, including that of mybatis. One thing about your XML format suggestion, though: Modelling the actual Java outcome through elements like <tableClass/>, <tableStaticField/>, etc will be quite hard to maintain on the jooq-generator side (maintaining this XML language, adding new elements with new feature requests, integration testing all corner cases, etc.). I prefer to have an XML format only containing database meta-information, moving code generation "styling" elsewhere. > 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. Let's wait and see what Aaron produces with Xtend this week.
