Eclipse插件:MyBatis代碼生成器

編寫generatorConfing代碼

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
  <!--數(shù)據(jù)庫驅(qū)動路徑,一定要引用本地的驅(qū)動包,否則會報找不到mysql driver class-->
  <classPathEntry location="D:\JAVA\maven\repositories\mysql\mysql-connector-java\5.0.4\mysql-connector-java-5.0.4.jar" />  
  <context id="context1">
    <commentGenerator>
        <!-- 刪除代碼中帶有 代碼生成器的注釋信息  -->
        <property name="suppressAllComments" value="true" />
        <property name="suppressDate" value="true" />
    </commentGenerator>
  
    <jdbcConnection connectionURL="jdbc:mysql://192.168.1.103:3306/mydb" driverClass="com.mysql.jdbc.Driver" password="rootroot" userId="root" />
    <javaModelGenerator targetPackage="com.plg.shiro.entity" targetProject="springmvc-mybatis-shiro/src/main/java" />
    <sqlMapGenerator targetPackage="mapper" targetProject="springmvc-mybatis-shiro/src/main/resources" />
    <javaClientGenerator targetPackage="com.plg.shiro.dao" targetProject="springmvc-mybatis-shiro/src/main/java" type="XMLMAPPER" />
    
    <table tableName=""></table>
    <!-- <table tableName="om_menu" schema="" enableSelectByExample="false" enableDeleteByExample="false" enableCountByExample="false" enableUpdateByExample="fasle" /> -->
  </context>
</generatorConfiguration>

運(yùn)行g(shù)eneratorConfing代碼

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容