• Mybaits 生产mapper


    1、maven中添加插件

      

     <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
                <plugin>
                    <groupId>org.mybatis.generator</groupId>
                    <artifactId>mybatis-generator-maven-plugin</artifactId>
                    <version>1.3.7</version>
                    <dependencies>
                            <dependency> <groupId>tk.mybatis</groupId>
                                <artifactId>mapper</artifactId>
                                <version>4.0.3</version>
                            </dependency>
    
                        <dependency>
                            <groupId> mysql</groupId>
                            <artifactId> mysql-connector-java</artifactId>
                            <version>8.0.16</version>
                        </dependency>
                        <dependency>
                            <groupId>org.mybatis.generator</groupId>
                            <artifactId>mybatis-generator-core</artifactId>
                            <version>1.3.7</version>
                        </dependency>
                        <dependency>
                            <groupId>javax.servlet</groupId>
                            <artifactId>javax.servlet-api</artifactId>
                            <version>3.1.0</version>
                            <scope>provided</scope>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>Generate MyBatis Artifacts</id>
                            <phase>package</phase>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <!--允许移动生成的文件 -->
                        <verbose>true</verbose>
                        <!-- 是否覆盖 -->
                        <overwrite>false</overwrite>
                        <!-- 自动生成的配置 -->
                        <configurationFile>src/main/resources/mybatis-generater.xml</configurationFile>
                    </configuration>
                </plugin>
    
            </plugins>
        </build>
    

      2、配置 mybatis-generater.xml

  • 相关阅读:
    从零开始搭建系统1.2——Nginx安装及配置
    从零开始搭建系统1.1——CentOs安装
    从零开始搭框架——系统架构
    从零开始搭建系统——前言
    PHP语法入门以及变量
    用PHP写出计算器
    PHP常量以及基本数据类型
    PHP入门了解
    php中搭建Web服务器和服务器配置
    JS中for,for...in,for...of以及foreach循环的用法
  • 原文地址:https://www.cnblogs.com/irobotzz/p/12855689.html
Copyright © 2020-2023  润新知