zoukankan      html  css  js  c++  java
  • 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>
    
    金麟岂是池中物,一遇风云便化龙!
  • 相关阅读:
    CentOS Linux 7 安装教程
    计算机网络概念
    计算机操作系统概念简介
    基础-计算机及操作系统和应用程序的概念
    Spring mvc注解说明
    kaptcha Spring 整合
    Spring常用注解
    Spring bean的自动装配属性
    HQL(Hibernate Query language)语言
    JDBC、Hibernate、Java类型对照表
  • 原文地址:https://www.cnblogs.com/ABKing/p/12492041.html
Copyright © 2011-2022 走看看