zoukankan      html  css  js  c++  java
  • 草稿

    1.在pom.xml中引入mybatis自动生成代码插件

        <build>
            <plugins>
                <!-- mybatis generator 自动生成代码插件 -->
                <plugin>
                    <groupId>org.mybatis.generator</groupId>
                    <artifactId>mybatis-generator-maven-plugin</artifactId>
                    <version>1.3.2</version>
                    <configuration>
                        <verbose>true</verbose>
                        <overwrite>true</overwrite>
                    </configuration>
                </plugin>
            </plugins>
        </build>

    2.

    generatorConfig.xml的内容如下:

    <?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>
        <classPathEntry
                location="F:apache-maven-3.5.0LocalMavenRepositorymysqlmysql-connector-java5.1.38mysql-connector-java-5.1.38.jar" />
        <context id="context1">
            <commentGenerator>
                <property name="suppressAllComments" value="true" /><!-- 是否取消注释 -->
                <property name="suppressDate" value="true" /> <!-- 是否生成注释代时间戳 -->
            </commentGenerator>
            <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                            connectionURL="jdbc:mysql://localhost:3306/jianwu" userId="qukan"
                            password="quk_live123" />
            <!-- 实体-->
            <javaModelGenerator targetPackage="com.jianwu.win.entity"
                                targetProject="F:jianwutestWinsrcmainjava" />
            <!--mapper.xml-->
            <sqlMapGenerator targetPackage="com.jianwu.win.dao"
                             targetProject="F:jianwutestWinsrcmainjava" />
            <!--mapper.java-->
            <javaClientGenerator targetPackage="com.jianwu.win.dao"
                                 targetProject="F:jianwutestWinsrcmainjava" type="XMLMAPPER" />
    
            <table schema="jianwu" tableName="user"
                   enableCountByExample="false" enableSelectByExample="false"
                   enableDeleteByExample="false" enableUpdateByExample="false">
            </table>
    
        </context>
    </generatorConfiguration>

    然后刷新下就会出现

    双击生成代码

  • 相关阅读:
    php 中 return exit break contiue 详解
    C++ Primer学习笔记2--c++标准库中的 vector、string 和 bitset 类型
    asp.net 生成xml文件 与 asp生成xml文件
    android 性能优化
    Internet基础
    华为一道机试
    智能家居趋势
    hdu4708 Rotation Lock Puzzle
    java要在命令行执行eclipse的项目的方法
    linux和windows下安装python拓展包及requirement.txt安装类库
  • 原文地址:https://www.cnblogs.com/ENU7/p/9481911.html
Copyright © 2011-2022 走看看