zoukankan      html  css  js  c++  java
  • mybatis.generator.plugins生成基础类

    <?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>
    
        <context id="test" targetRuntime="MyBatis3">
    
            <!-- 实体类重命名规则:尾部统一添加Entity -->
            <!--<property name="domainObjectNameSuffix" value="Entity"/>-->
            <!--<property name="domainObjectNameSuffixExcludeTables" value=""/>-->
    
            <!--<plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"/>-->
            <plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
            <!--<plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>-->
    
            <commentGenerator>
                <!-- 这个元素用来去除指定生成的注释中是否包含生成的日期 false:表示保护 -->
                <!-- 如果生成日期,会造成即使修改一个字段,整个实体类所有属性都会发生变化,不利于版本控制,所以设置为true -->
                <property name="suppressDate" value="true"/>
                <!-- 是否去除自动生成的注释 true:是 : false:否 -->
                <property name="suppressAllComments" value="true"/>
            </commentGenerator>
    
            <!--数据库链接URL,用户名、密码 -->
            <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                            connectionURL="jdbc:mysql://xxxxx:3306/xx?useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull"
                            userId="xxxx" password="xxxxx">
            </jdbcConnection>
    
            <javaTypeResolver>
                <!-- This property is used to specify whether MyBatis Generator should
                    force the use of java.math.BigDecimal for DECIMAL and NUMERIC fields, -->
                <property name="forceBigDecimals" value="false"/>
            </javaTypeResolver>
    
            <!-- 实体类生成的位置 -->
            <javaModelGenerator targetPackage="com.xxxx.model" targetProject="../xxx-model/src/main/java">
                <property name="enableSubPackages" value="true"/>
                <property name="trimStrings" value="true"/>
            </javaModelGenerator>
    
            <!-- *Mapper.xml 文件的位置 -->
            <sqlMapGenerator targetPackage="com.xxxx.mapper"
                             targetProject="../ydq-dao/src/main/java">
                <property name="enableSubPackages" value="true"/>
            </sqlMapGenerator>
    
            <!-- dao 接口文件的位置 -->
            <javaClientGenerator targetPackage="com.xxxxx.dao"
                                 targetProject="../xxxx/src/main/java" type="XMLMAPPER">
                <property name="enableSubPackages" value="true"/>
            </javaClientGenerator>
    
            <!-- 相关表的配置 -->
            <!--<table tableName="xxxxxx"-->
                   <!--enableCountByExample="true" enableDeleteByExample="false"-->
                   <!--enableSelectByExample="true" enableUpdateByExample="true">-->
                <!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>-->
                <!--<columnOverride column="status" jdbcType="INTEGER" javaType="java.lang.Integer"/>-->
            <!--</table>-->
            <!--<table tableName="xxxxxx"-->
                   <!--enableCountByExample="true" enableDeleteByExample="false"-->
                   <!--enableSelectByExample="true" enableUpdateByExample="true">-->
                <!--<generatedKey column="ID" sqlStatement="JDBC" identity="true"/>-->
            <!--</table>-->
            <table tableName="xxxxxx"
            enableCountByExample="true" enableDeleteByExample="false"
            enableSelectByExample="true" enableUpdateByExample="true">
            <generatedKey column="ID" sqlStatement="JDBC" identity="true"/>
            </table>
    
        </context>
    </generatorConfiguration>
    人这辈子没法做太多事情,所以每做一件事都要做到精彩绝伦。 因为,这就是我的宿命。人生苦短,你明白吗? 所以这是我为人生做出的选择
  • 相关阅读:
    cygwin下安装scws
    atitit.提升软件开发的生产力关健点-------大型开发工具最关健
    atitit。mssql sql server 转换mysql 及 分页sql ast的搭建
    atitit.手动配置列表文件的选择and 数据的层次结构 attilax总结最佳实践--yaml
    atitit.获取connection hibernate4
    atitit.新增编辑功能 跟orm的实现 attilax p31
    atitit.自动生成数据库结构脚本,或者更换数据库,基于hibernate4
    atitit.Windows Server 2003 2008 2012系统的新特性 attilax 总结
    atitit.orm的缺点与orm框架市场占有率,选型attilax总结
    atitit。解决 No suitable Log constructor。。NoClassDefFoundError: org/apache/log4j/Category 找不到类的
  • 原文地址:https://www.cnblogs.com/junjun1578/p/15719296.html
Copyright © 2011-2022 走看看