Mysql8 + MyBatis Generator生成代碼生成多餘文件

環境介紹:
mysql8

generatorConfig.xml配置文件:

<table tableName="%">
      <generatedKey column="id" sqlStatement="Mysql" identity="true"/>
</table>

配置後運行mybatisGenerate插件,會生成很多文件,其中有些並不是在自己指定的數據庫中,名稱很奇怪,好像是把mysql所有表都給處理了一遍

解決方法:

<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver" connectionURL="jdbc:mysql://localhost/***"
            userId="***" password="*****">
        <property name="nullCatalogMeansCurrent" value="true" />
</jdbcConnection>

加粗傾斜的語句是關鍵
參考資料:
http://www.mybatis.org/generator/usage/mysql.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章