java - Jooq generates POJO missing comments -
eg.
sql:
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`) ) engine=innodb default charset=utf8mb4 comment='collect';
the resulting pojo follows.
/** * collect */ @generated( value = { "http://www.jooq.org", "jooq version:3.9.2" }, comments = "this class generated jooq" ) @suppresswarnings({ "all", "unchecked", "rawtypes" }) public class collect implements serializable { private integer travelid; private string description; private localdatetime creattime; ... }
the pojo want should this.
eg:
private integer travelid //trave_lid
or
/* trave_lid */ private integer travelid
my code generator:
.withpojos(true) .withdaos(true) .withspringannotations(true) .withjavatimetypes(true)
the pojo field not have corresponding comment. should do?
currently (as of jooq 3.9 , 3.10), comments generated on tables , records, not on pojos. that's missing feature should implemented in future jooq version. i've created feature request this: https://github.com/jooq/jooq/issues/6456
you can override javagenerator
class jooq-codegen in order generate comments manually, e.g. overriding javagenerator.generatepojo()
.
Comments
Post a Comment