<?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="D:\RepositoryGit\MyBatisGenerator1.3.5\mysql-connector-java-5.1.36.jar" /> <context id="mysqlTables" targetRuntime="MyBatis3"> <!-- 生成的‘实体类’将implements Serializable --> <plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin> <!-- 是否成成注释--> <commentGenerator> <property name="suppressAllComments" value="true" /> <property name="suppressDate" value="true" /> </commentGenerator> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3306/test"
userId="root" password="mysql" /> <!--指定生成的类型为java类型,避免数据库中number等类型字段 --> <javaTypeResolver> <property name="forceBigDecimals" value="false" /> </javaTypeResolver>
<!--自动生成的实体的存放包路径 --> <javaModelGenerator targetPackage="com.example.dao.mybatis.entity" targetProject="src/main/java"> <property name="enableSubPackages" value="true" /> <property name="trimStrings" value="true" /> </javaModelGenerator>
<!--自动生成的*Mapper.xml文件存放路径 --> <sqlMapGenerator targetPackage="com.example.dao.mybatis.sqlMap" targetProject="src/main/java"> <property name="enableSubPackages" value="true" /> </sqlMapGenerator>
<!--自动生成的*Mapper.java存放路径 --> <javaClientGenerator type="XMLMAPPER" targetPackage="com.example.dao.mybatis.mapper"
targetProject="src/main/java"> <property name="enableSubPackages" value="true" /> </javaClientGenerator>
<table tableName="user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> <generatedKey column="id" sqlStatement="SELECT LAST_INSERT_ID()" identity="false" /> </table>
</context> </generatorConfiguration>
|