One of the goodies of vertx-jooq is that it allows you to automatically convert POJOs and jOOQ-Records from and into JSON-Objects. Until now however, the key of the generated JSON-field was fixed to the POJO’s member name that represents that column (which stays the default). Starting with version 2.3.5 this behavior can be changed in different ways:
- Subclass the
VertxGeneratorof your choice and overwrite
VertxGeneratorStrategyof your choice and overwrite
- Set a different delegate used by the
VertxGeneratorStrategy(see also #6) and change the way how the POJO’s member names are rendered.
Imagine you want the JSON keys to be exactly the same as their database column counterparts. Here is how you would do it in all three different methods:
Whatever way you prefer, you also need to alter your code generation configuration and set the correct
GeneratorStrategy. Checkout the github page for a how-to or if you’re new to vertx-jooq.