mybatis配置文件
2016-04-03 16:44
239 查看
<?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> <!-- 数据库驱动 , sql驱动完整路径 --> <classPathEntry location="D:\maven\mvnRespo\jar\mysql\mysql-connector-java\5.1.30\mysql-connector-java-5.1.30.jar" /> <context id="DB2Tables" targetRuntime="MyBatis3"> <commentGenerator> <property name="suppressDate" value="true" /> <!-- 是否去除自动生成的注释 true:是 : false:否 --> <property name="suppressAllComments" value="true" /> </commentGenerator> <!--数据库链接URL,用户名、密码 --> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/stuapp?characterEncoding=utf-8" userId="root" password="P@ssw0rd"> </jdbcConnection> <javaTypeResolver> <property name="forceBigDecimals" value="false" /> </javaTypeResolver> <!-- 生成模型的包名和位置 --> <javaModelGenerator targetPackage="com.xpz.StuApp.pojo" targetProject="D:\eclipse\StuApp\src\main\java"> <property name="enableSubPackages" value="true" /> <property name="trimStrings" value="true" /> </javaModelGenerator> <!-- 生成映射文件的包名和包所在完整位置 --> <sqlMapGenerator targetPackage="com.xpz.StuApp.mapping" targetProject="D:\eclipse\StuApp\src\main\java"> <property name="enableSubPackages" value="true" /> </sqlMapGenerator> <!-- 生成DAO的包名和位置 --> <javaClientGenerator type="XMLMAPPER" targetPackage="com.xpz.StuApp.dao" targetProject="D:\eclipse\StuApp\src\main\java"> <property name="enableSubPackages" value="true" /> </javaClientGenerator> <!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名 --> <table tableName="t_manager" domainObjectName="Manager" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <table tableName="t_student" domainObjectName="Student" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> <table tableName="t_teacher" domainObjectName="Teacher" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> </context> </generatorConfiguration>
相关文章推荐
- DLUTOJ 1209 字典序和r-子集
- java如何得到GET和POST请求URL和参数列表
- canvas 橡皮擦效果制作
- 排序算法杂记
- 【Java】豆机
- 最小的k个数
- iOS性能优化:Instruments使用实战
- 利用NSCache提升效率
- HDU1695 GCD (欧拉函数+容斥原理)
- Java回调机制解析
- Maven+Spring+SpringMVC+MyBatis框架的搭建(二)
- java 学习心得
- Sublime Text常用快捷键总结附上gif图 更加清晰
- linux下如何检测程序是否运行并重启
- NSoperation和GCD的使用场景
- VJ【背包】
- Fiddler 使用教程
- LightOJ 1138 - Trailing Zeroes (III) (求末尾0为x的最小N---二分)
- hdoj 小兔的棋盘 2067 (DP)
- 集合框架中LinkedList实现类代码分析