<?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:数据库的JDBC驱动的jar包地址 -->
<classPathEntry
location="D:\software\maven\repo\mysql\mysql-connector-java\5.1.46\mysql-connector-java-5.1.46.jar" />
<context id="MysqlTables" targetRuntime="MyBatis3">
<commentGenerator>
<!-- 是否去除自动生成的注释 true:是 false:否 -->
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!--数据库连接的信息:驱动类、连接地址、用户名、密码 -->
<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@xx.xx.x.xxx:1521:xx"
userId="xx"
password="1">
</jdbcConnection>
<!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,
true,把JDBC DECIMAL 和 NUMERIC 类型解析为java.math.BigDecimal -->
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- 生成实体类地址 -->
<!-- targetProject:自动生成代码的位置 -->
<javaModelGenerator targetPackage="com.rabbitmq.topic.entity"
targetProject="src/main/java">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
<!-- 是否针对string类型的字段在set的时候进行trim调用 -->
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- 生成XxxMapper.xml文件 -->
<sqlMapGenerator targetPackage="mapper"
targetProject="src/main.resources">
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<!-- 生成接口 XxxMapper.java -->
<javaClientGenerator type="XMLMAPPER"
targetPackage="com.rabbitmq.topic.mapper"
targetProject="src/main/java">
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<!-- tableName:用于自动生成代码的数据库表;domainObjectName:对应于数据库表的javaBean类名 -->
<table tableName="tbl_user" domainObjectName="User"
enableCountByExample="true" enableUpdateByExample="true"
enableDeleteByExample="true" enableSelectByExample="true"
selectByExampleQueryId="true" >
</table>
</context>
</generatorConfiguration>
网友评论