nili 3 years ago
parent
commit
df0f040f51
  1. 57
      luigi-dao/src/main/resources/mybatis-generator/generatorConfig.xml
  2. 7
      luigi-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties

57
luigi-dao/src/main/resources/mybatis-generator/generatorConfig.xml

@ -0,0 +1,57 @@
<?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>
<!-- 引入配置文件 -->
<properties resource="mybatis-generator/mybatisGeneratorinit.properties"/>
<context id="MysqlTables" targetRuntime="MyBatis3" defaultModelType="flat">
<property name="autoDelimitKeywords" value="true"/>
<property name="beginningDelimiter" value="`"/>
<property name="endingDelimiter" value="`"/>
<property name="javaFileEncoding" value="utf-8"/>
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
<plugin type="com.bczgame.server.common.mybatis.MySQLLimitPlugin"/>
<!-- 注释 -->
<commentGenerator>
<property name="suppressAllComments" value="false"/><!-- 是否取消注释 -->
<property name="suppressDate" value="true"/> <!-- 是否生成注释代时间戳-->
</commentGenerator>
<!-- jdbc连接 -->
<jdbcConnection driverClass="${jdbc_driver}" connectionURL="${jdbc_url}" userId="${jdbc_user}"
password="${jdbc_password}"/>
<!-- 类型转换 -->
<javaTypeResolver>
<!-- 是否使用bigDecimal, false可自动转化以下类型(Long, Integer, Short, etc.) -->
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!-- 生成实体类地址 -->
<javaModelGenerator targetPackage="com.bzgame.server.luigi.dao.domain" targetProject="${project}">
<property name="enableSubPackages" value="false"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!-- 生成mapxml文件 -->
<sqlMapGenerator targetPackage="mapper" targetProject="${resources}">
<property name="enableSubPackages" value="false"/>
</sqlMapGenerator>
<!-- 生成mapxml对应client,也就是接口dao -->
<javaClientGenerator targetPackage="com.bzgame.server.luigi.dao.mapper" targetProject="${project}"
type="XMLMAPPER">
<property name="enableSubPackages" value="false"/>
</javaClientGenerator>
<table tableName="author" enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<property name="useActualColumnNames" value="false"/>
<generatedKey column="id" sqlStatement="Mysql" identity="true"/>
<ignoreColumn column="created_at"/>
<ignoreColumn column="updated_at"/>
</table>
</context>
</generatorConfiguration>

7
luigi-dao/src/main/resources/mybatis-generator/mybatisGeneratorinit.properties

@ -0,0 +1,7 @@
#Mybatis Generator configuration
project =src/main/java
resources=src/main/resources
jdbc_driver =com.mysql.jdbc.Driver
jdbc_url=jdbc:mysql://localhost:3306/mario
jdbc_user=root
jdbc_password=
Loading…
Cancel
Save