ChunfyTseng ChunfyTseng - 3 years ago 48
SQL Question

Jooq generates POJO missing comments



CREATE TABLE `collect` (
`travel_id` int NOT NULL COMMENT 'travel id',
`description` varchar(64) COMMENT 'description',
`creat_time` timestamp DEFAULT CURRENT_TIMESTAMP COMMENT 'creat time',
PRIMARY KEY (`travel_id`)

The resulting POJO is as follows.

* collect
value = {
"jOOQ version:3.9.2"
comments = "This class is generated by jOOQ"
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Collect implements Serializable {

private Integer travelId;
private String description;
private LocalDateTime creatTime;


The POJO I want should be like this.


private Integer travelId //trave_lId


/* trave_lId */
private Integer travelId

my code generator:


the POJO field does not have a corresponding comment.
what should i do?

Answer Source

Currently (as of jOOQ 3.9 and 3.10), comments are only generated on tables and records, not on POJOs. That's a missing feature which should be implemented in a future jOOQ version. I've created a feature request for this:

You can override the JavaGenerator class from jooq-codegen in order to generate those comments manually, e.g. by overriding JavaGenerator.generatePojo().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download