Mybatis可以为表,字段添加注释
表添加注释
Mapper
void commentTable(@Param("tableName") String tableName, @Param("comment") String comment);
Mapper.xml
<update id="commentTable">
COMMENT ON TABLE "${tableName}" IS '${comment}'
</update>
字段添加注释
Mapper
void commentTableColumn(@Param("tableName") String tableName, @Param("column") String column, @Param("comment") String comment);
Mapper.xml
<update id="commentTableColumn">
COMMENT ON COLUMN "${tableName}"."${column}" IS '${comment}'
</update>