【问题标题】:Mybatis generator addRemarkComments for oracle not workingMybatis 生成器 addRemarkComments for oracle 不工作
【发布时间】:2018-03-05 02:12:38
【问题描述】:

我在eclipse中使用了带有maven的mybatis生成器。

我想在生成的类、字段和方法上添加 cmets。

我将 coomentGenerator 配置如下,但它没有添加任何 cmets。

<commentGenerator>
 <property name="suppressAllComments" value="false" />
 <property name="addRemarkComments" value="true" />
</commentGenerator>

我的数据库是oracle,表和字段都有cmets。

我确认 all_tab_cmets、all_col_cmets 有用于我的表和列的 cmets。

我使用 1.3.5 版本的 mybatis-generator-maven-plugin

【问题讨论】:

    标签: oracle mybatis mybatis-generator


    【解决方案1】:

    Oracle 的 JDBC 驱动默认不返回备注。详情见本页:https://docs.oracle.com/database/121/JJDBC/oraperf.htm#JJDBC28785

    要为生成器启用它,您必须将连接属性添加到您的&lt;jdbcConnection&gt;

    &lt;property name="remarksReporting" value="true"/&gt;

    【讨论】:

    • 也不行。 context.addProperty("remarksReporting", Boolean.TRUE.toString()); JDBCConnectionConfiguration jdbcConnectionConfiguration = new JDBCConnectionConfiguration();
    • 将其作为属性添加到 jdbcConnection,而不是上下文。
    • 谢谢!我通过将 mybatis generate pom 源移动到我的项目中来解决,更改 jdbcConnection 连接代码,然后它就可以工作了。@Jeff Butler
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-28
    • 2015-03-23
    • 2013-07-24
    相关资源
    最近更新 更多