meaven 配置mybatis generator jdbc 6.0 generatorConfig配置文件

中途遇到 很多问题 做了笔记有时间 整理出来 分享

不早了明天上班 就先贴出配置文件 希望对大家有帮助




<generatorConfiguration>

    <classPathEntry location="D:\mysqldriver\mysql-connector-java-6.0.6.jar" />

    <context id="context1" targetRuntime="MyBatis3">

        
        
        

        <commentGenerator>
            <property name="suppressDate" value="true" />
            <property name="suppressAllComments" value="true" />
        commentGenerator>

        <jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
            connectionURL="jdbc:mysql://127.0.0.1:3309/test?characterEncoding=utf8&useSSL=true&createDatabaseIfNotExist=true&serverTimezone=GMT&nullNamePatternMatchesAll=true"
            userId="root" password="sadsad" />

        
        <javaModelGenerator targetPackage="sql.test.model"
            targetProject="src/main/java" />

        <sqlMapGenerator targetPackage="sql.test.resource"
            targetProject="src/main/resources">
        sqlMapGenerator>

        <javaClientGenerator type="XMLMAPPER"
            targetPackage="test.dao" targetProject="src/main/java" />

        
        <table schema="test" tableName="sm_user" domainObjectName="SMUser"
            enableCountByExample="false" enableUpdateByExample="false"
            enableDeleteByExample="false" enableSelectByExample="false"
            selectByExampleQueryId="false">

            <property name="useActualColumnNames" value="true" />

        table>
    context>
generatorConfiguration>




你可能感兴趣的:(Java基础篇)