配置文件generatorConfig.xml
2017-05-12 12:14
253 查看
配置文件generatorConfig.xml
文件路径
主要有三点:
1.新建配置文件。
2.指定jar包位置。
3.修改targetProject 路径
<?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:\mavenLib\mysql\mysql-connector-java\5.1.29\mysql-connector-java-5.1.29.jar" />
<!-- <classPathEntry location="C:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar" />-->
<context id="my" targetRuntime="MyBatis3">
<!-- 生成的pojo,将implements Serializable-->
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
<!-- <commentGenerator> -->
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<!-- <property name="suppressAllComments" value="false" /> -->
<!-- </commentGenerator> -->
<commentGenerator>
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!-- 数据库链接URL、用户名、密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.1.32:3306/douniu_db?characterEncoding=utf8" userId="root" password="root1234">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- 生成模型的包名和位置 -->
<javaModelGenerator targetPackage="com.niuniu.game.plate.entity.test" targetProject="DouNiu/src/main/java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- 生成的映射文件包名和位置 -->
<sqlMapGenerator targetPackage="com.niuniu.game.plate.mapper.test" targetProject="DouNiu/src/main/java">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!-- 生成DAO的包名和位置 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.niuniu.game.plate.dao.test" targetProject="DouNiu/src/main/java">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!-- 要生成那些表(更改tableName和domainObjectName就可以) -->
<table tableName="tbl_plate_round_score" domainObjectName="PlateRoundScore" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />
<!-- <table tableName="course_info" domainObjectName="CourseInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />
<table tableName="course_user_info" domainObjectName="CourseUserInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" /> -->
</context>
</generatorConfiguration>
文件路径
主要有三点:
1.新建配置文件。
2.指定jar包位置。
3.修改targetProject 路径
<?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:\mavenLib\mysql\mysql-connector-java\5.1.29\mysql-connector-java-5.1.29.jar" />
<!-- <classPathEntry location="C:\oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar" />-->
<context id="my" targetRuntime="MyBatis3">
<!-- 生成的pojo,将implements Serializable-->
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
<!-- <commentGenerator> -->
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<!-- <property name="suppressAllComments" value="false" /> -->
<!-- </commentGenerator> -->
<commentGenerator>
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!-- 数据库链接URL、用户名、密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://192.168.1.32:3306/douniu_db?characterEncoding=utf8" userId="root" password="root1234">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- 生成模型的包名和位置 -->
<javaModelGenerator targetPackage="com.niuniu.game.plate.entity.test" targetProject="DouNiu/src/main/java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- 生成的映射文件包名和位置 -->
<sqlMapGenerator targetPackage="com.niuniu.game.plate.mapper.test" targetProject="DouNiu/src/main/java">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!-- 生成DAO的包名和位置 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.niuniu.game.plate.dao.test" targetProject="DouNiu/src/main/java">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!-- 要生成那些表(更改tableName和domainObjectName就可以) -->
<table tableName="tbl_plate_round_score" domainObjectName="PlateRoundScore" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />
<!-- <table tableName="course_info" domainObjectName="CourseInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" />
<table tableName="course_user_info" domainObjectName="CourseUserInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" /> -->
</context>
</generatorConfiguration>
相关文章推荐
- Mybatis 如何自动生成bean dao xml 配置文件 generatorconfig.xml (main()方法自动生成更快捷)
- 【MyBatis】MyBatis Generator插件自动生成文件,generatorConfig.xml配置详解
- Mybatis 通过配置文件generatorConfig.xml生成文件--Maven插件运行方式
- Mybatis 如何自动生成bean dao xml 配置文件 generatorconfig.xml (mysql)
- generatorConfig.xml文件配置
- mybatis generatorConfig.xml生成配置文件及三种运行方式
- Mybatis 通过配置文件generatorConfig.xml生成文件--cmd方式
- Mybatis 通过配置文件generatorConfig.xml生成文件--main方法执行方式
- 【MyBatis】MyBatis-generator的配置文件 generatorConfig.xml
- Mybatis 如何自动生成bean dao xml 配置文件 generatorconfig.xml (main()方法自动生成更快捷)
- Mybatis 如何自动生成bean dao xml 配置文件 generatorconfig.xml
- Myeclipse的插件mybatis-generator创建的配置文件generatorConfig.xml的配置详细说明
- Struts-config.xml配置文件讲解(四)
- Struts-config.xml配置文件讲解
- struts 使用多个配置文件 struts-config.xml
- 搭建SSH框架的时候的struts-config.xml配置文件(用controller管理)
- Struts-config.xml配置文件讲解
- SqlMapConfig.xml是ibatis连接数据库的配置文件
- struts-config.xml文件中配置数据源
- Struts-config.xml配置文件《action-mappings》元素的详解