generatorConfig.xml(自动生成实体类等配置详解)

<?xml version="1.0" encoding="UTF-8" ?>
    <!-- 你本地mysql jar保存的位置-->
<classPathEntry
        location="D:\repository\mysql\mysql-connector-java\5.1.13\mysql-connector-java-5.1.13.jar"/>
<context id="context1" targetRuntime="MyBatis3">

    <!-- 序列化-->
    <plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>



    <!-- 去注释 -->
    <commentGenerator>
        <property name="suppressAllComments" value="true" />
        <property name="suppressDate" value="true" />
    </commentGenerator>

    <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                    connectionURL="jdbc:mysql://127.0.0.1:3306/wine"
                    userId="root"
                    password="123456" />
    <!-- 生成实体类信息-->
    <javaModelGenerator targetPackage="com.entity"
                        targetProject="src/main/java" />
    <!-- 生成mapxml文件 -->
    <sqlMapGenerator targetPackage="mybatis.mapper"
                     targetProject="src/main/resources" />
    <!-- 生成mapxml对应client,也就是接口dao -->
    <javaClientGenerator targetPackage="com.dao"
                         targetProject="src/main/java" type="XMLMAPPER" />

    <table schema="sysInfoUser" tableName="sys_info_user"
           enableCountByExample="false" enableUpdateByExample="false"
           enableDeleteByExample="false" enableSelectByExample="false"
           selectByExampleQueryId="false" />



</context>

猜你喜欢

转载自blog.csdn.net/weixin_40753536/article/details/89210227
今日推荐