• 01-创建项目


    创建父工程

    InnovationAndEntrepreneurship-admin-parent

    创建父工程下的三个子模块:

    • InnovationAndEntrepreneurship-admin-webui
    • InnovationAndEntrepreneurship-admin-component
    • InnovationAndEntrepreneurship-admin-entity

    另外再创建另外两个maven工程:

    • InnovationAndEntrepreneurship-admin-util
    • InnovationAndEntrepreneurship-admin-reverse

    其中,InnovationAndEntrepreneurship-admin-util作为公共工具模块,导入父工程中。(具体方法见:https://www.cnblogs.com/ABKing/p/12470699.html)

    使用mybatis逆向工程

    通过mybatis逆向工程,生成所需的entity,Mapper接口和Mapper.xml文件

    reverse工程的pom.xml内容如下:

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>top.bigking</groupId>
        <artifactId>InnovationAndEntrepreneurship-admin-reverse</artifactId>
        <version>1.0-SNAPSHOT</version>
        <dependencies>
            <!-- 依赖MyBatis核心包 -->
            <dependency>
                <groupId>org.mybatis</groupId>
                <artifactId>mybatis</artifactId>
                <version>3.2.8</version>
            </dependency>
    
        </dependencies>
    
        <!-- 控制Maven在构建过程中相关配置 -->
        <build>
    
            <!-- 构建过程中用到的插件 -->
            <plugins>
    
                <!-- 具体插件,逆向工程的操作是以构建过程中插件形式出现的 -->
                <plugin>
                    <groupId>org.mybatis.generator</groupId>
                    <artifactId>mybatis-generator-maven-plugin</artifactId>
                    <version>1.3.0</version>
    
                    <!-- 插件的依赖 -->
                    <dependencies>
    
                        <!-- 逆向工程的核心依赖 -->
                        <dependency>
                            <groupId>org.mybatis.generator</groupId>
                            <artifactId>mybatis-generator-core</artifactId>
                            <version>1.3.2</version>
                        </dependency>
    
                        <!-- 数据库连接池 -->
                        <dependency>
                            <groupId>com.mchange</groupId>
                            <artifactId>c3p0</artifactId>
                            <version>0.9.2</version>
                        </dependency>
    
                        <!-- MySQL驱动 -->
                        <dependency>
                            <groupId>mysql</groupId>
                            <artifactId>mysql-connector-java</artifactId>
                            <version>5.1.8</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </build>
    </project>
    
    金麟岂是池中物,一遇风云便化龙!
  • 相关阅读:
    (项目)在线教育平台(四)
    (项目)在线教育平台(三)
    (项目)在线教育平台(二)
    (项目)在线教育平台(一)
    (面试题)python面试题集锦-附答案
    (python)面向对象
    (python)数据结构---元组
    myEclipse 配置tomcat清除缓存
    Jquery浅克隆与深克隆
    列表上下无缝滚动
  • 原文地址:https://www.cnblogs.com/ABKing/p/12492041.html
Copyright © 2020-2023  润新知