For my own project, I've cleaned/improved (well, depending on your point of 
view ;) ) the code in DefaultGenerator (
https://github.com/lukaseder/jOOQ/blob/master/jOOQ-codegen/src/main/java/org/jooq/util/DefaultGenerator.java
).

The work is based on the wisdom that I've gathered with code generators 
over the past 20 years:

   - database is now a field for most methods
   - The huge generate methods have been split into many smaller methods 
   where each method generates one piece of the code. Each of them is 
   protected to allow to modify the generated code
   - Removed the XXX comments since each piece of code can now be found in 
   its own method.
   - Wrap all checked exception in RuntimeException to get rid of useless 
   try-catch blocks and throws lists

The result allows me to generate additional getters/setters for foreign 
keys which accept the remote type as value to set the ID.

I'm willing to contribute these changes back. Let me know if you're 
interested.

Regards,

A. Digulla

Reply via email to