黄色网址大全免费-黄色网址你懂得-黄色网址你懂的-黄色网址有那些-免费超爽视频-免费大片黄国产在线观看

SpringBoot教程
SpringBoot入門案例
SpringBoot框架Web開發(fā)
SpringBoot非web應用程序
SpringBoot使用攔截器
SpringBoot中使用Servlet
SpringBoot中使用Filter
SpringBoot項目配置字符編碼
SpringBoot打包與部署
SpringBoot使用Actuator
SpringBoot集成Thymeleaf模板
SpringBoot總結(jié)及綜合案例
SpringBoot工程下使用Mybatis反向工程

SpringBoot工程下使用Mybatis反向工程

拷貝Mybatis反向工程配置文件到項目的根目錄下

獲取目錄:GeneratorMapper.xml

根據(jù)項目及表的情況,修改GeneratorMapper.xml配置

紅色標準的地方是需要確認修改的地方,尤其注意

• 如果使用高版本,驅(qū)動類變?yōu)椋篶om.mysql.cj.jdbc.Driver

• url后面應該加屬性nullCatalogMeansCurrent=true,否則生成有問題

當前版本MySQL數(shù)據(jù)庫為5.7.18

<?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ù)庫的JDBC驅(qū)動包所在位置,指定到你本機的完整路徑 -->
    <classPathEntry location="E:\mysql-connector-java-5.1.38.jar"/>

    <!-- 配置table表信息內(nèi)容體,targetRuntime指定采用MyBatis3的版本 -->
    <context id="tables" targetRuntime="MyBatis3">

        <!-- 抑制生成注釋,由于生成的注釋都是英文的,可以不讓它生成 -->
        <commentGenerator>
            <property name="suppressAllComments" value="true" />
        </commentGenerator>

        <!-- 配置數(shù)據(jù)庫連接信息 -->
        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                        connectionURL="jdbc:mysql://localhost:3306/springboot"
                        userId="root"
                        password="123456">
        </jdbcConnection>

        <!-- 生成model類,targetPackage指定model類的包名, targetProject指定生成的model放在eclipse的哪個工程下面-->
        <javaModelGenerator targetPackage="com.bjpowernode.springboot.model" targetProject="src/main/java">
            <property name="enableSubPackages" value="false" />
            <property name="trimStrings" value="false" />
        </javaModelGenerator>

        <!-- 生成MyBatis的Mapper.xml文件,targetPackage指定mapper.xml文件的包名, targetProject指定生成的mapper.xml放在eclipse的哪個工程下面 -->
        <sqlMapGenerator targetPackage="com.bjpowernode.springboot.mapper" targetProject="src/main/java">
            <property name="enableSubPackages" value="false" />
        </sqlMapGenerator>

        <!-- 生成MyBatis的Mapper接口類文件,targetPackage指定Mapper接口類的包名, targetProject指定生成的Mapper接口放在eclipse的哪個工程下面 -->
        <javaClientGenerator type="XMLMAPPER" targetPackage="com.bjpowernode.springboot.mapper" targetProject="src/main/java">
            <property name="enableSubPackages" value="false" />
        </javaClientGenerator>

        <!-- 數(shù)據(jù)庫表名及對應的Java模型類名 -->
        <table tableName="t_student" domainObjectName="Student"
               enableCountByExample="false"
               enableUpdateByExample="false"
               enableDeleteByExample="false"
               enableSelectByExample="false"
               selectByExampleQueryId="false"/>
    </context>

</generatorConfiguration>

在pom.xml文件中添加mysql反向工程依賴

!--mybatis代碼自動生成插件-->

<plugin>
    <groupId>org.mybatis.generator</groupId>
    <artifactId>mybatis-generator-maven-plugin</artifactId>
    <version>1.3.6</version>
    <configuration>
        <!--配置文件的位置-->
        <configurationFile>GeneratorMapper.xml</configurationFile>
        <verbose>true</verbose>
        <overwrite>true</overwrite>
    </configuration>
</plugin>

雙擊紅色選中命令,生成相關文件

全部教程
主站蜘蛛池模板: www.亚洲一区二区三区 | 色综合天天干 | 亚洲成人手机在线 | 亚洲国产精品91 | 亚洲欧美综合一区二区三区四区 | 在线免费观看a级片 | 免费午夜影院 | 91精品国产91热久久p | 中文精品久久久久中文 | 欧美性猛交ⅹxxx乱大交按摩 | 黄色欧美在线观看 | 日本三级黄色片 | 波多野结衣在线中文字幕 | 亚洲区精品久久一区二区三区 | 一级毛片在线直接观看 | 欧美中文字幕一区 | 欧美精品国产综合久久 | 日韩视频在线精品视频免费观看 | 国产精品偷伦视频免费观看的 | 在线视频第一页 | 国模在线视频一区二区三区 | 制服美女视频一区 | 亚洲国产欧美在线观看 | 日韩中文字幕精品免费一区 | 国产色婷婷亚洲 | 中国美女一级a毛片录像在线 | 老色批在线播放视频网站免费 | 欧美在线视频免费播放 | 青草青草久热精品视频在线网站 | 就要操就要射 | 日本边添边摸边做边爱小视频 | 波多野结衣在线观看免费区 | 欧美2区 | 夜色资源网站 | 在线免费看a爱片 | 色噜噜色噜噜天天拍一拍 | 中文字幕一精品亚洲无线一区 | 久久成人亚洲 | 男女黄网站 | 欧美在线 | 亚洲 | 很黄很色的男女无遮挡动态图 |