I would like to add some annotations to generated pojo and dao classes. I know that I can override
JavaGenerator.printClassAnnotations(JavaWriter out, SchemaDefinition schema)
but problem is that this method is called for every generated file. I don't know how to limit my changes just for pojo or dao since I am not getting mode passed in :( Is there some other way? Thx.
Unfortunately, it is currently not easily possible to customise the generation output on this level.
A major rewrite of the code generator is planned for jOOQ 4.0, and custom annotations will definitely be part of it. Until then, I can think of these workarounds:
JavaGenerator
, replacing the relevant methods with a patched versionJavaGenerator
with your own custom logicThe last two workarounds will be the most powerful, although (obviously) at the risk of breaking at every minor release.