mybatis config 快速生成xml DAO
0.加jar包
1.a.BAT
java -jar E:\GZH\Mybaits\mybatis-generator-core-1.3.2\lib\mybatis-generator-core-1.3.2.jar -configfile E:\GZH\Mybaits\mybatis-generator-core-1.3.2\lib\generatorConfig.xml -overwrite
2.generatorConfig.xml
<?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="mysql-connector-java-5.1.25-bin.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/foen_zjt" userId="root" password="123456">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!-- 生成模型的包名和位置-->
<javaModelGenerator targetPackage="main.java.com.foen.zjt.entity" targetProject="src">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!-- 生成映射文件的包名和位置-->
<sqlMapGenerator targetPackage="main.resources.mapping" targetProject="src">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!-- 生成DAO的包名和位置-->
<javaClientGenerator type="XMLMAPPER" targetPackage="main.java.com.foen.zjt.mapping" targetProject="src">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<table tableName="web_link_info" domainObjectName="LinkInfoEntity" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="sys_log_info" domainObjectName="SysLogEntity" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
相关文章
- mybatis mapper映射文件全解
- Mybatis之基于XML的调用存储过程与手动回滚事务
- mybatis+spring报错PropertyAccessException 1: org.springframework.beans.MethodInvocationException
- Mybatis+mysql动态分页查询数据案例——配置映射文件(HouseDaoMapper.xml)
- Java_myBatis_xml代理写法
- MyBatis多表查询
- golang encoding/xml 解析多个根节点的XML文件
- Mybatis对oracle数据库进行foreach批量插入操作
- Java_myBatis_逆向工程
- Java_myBatis_XML代理_动态SQL
- MyBatis的执行原理详细介绍
- Atitti mybatis的单元测试attilax总结
- 【MyBatis笔记08】Mybatis中常用的一些操作
- MyBatis快速入门——第四章、mybatis动态sql_if_choose_when
- springboot基于mybatis扫描jar包中的controller、service、dao、xml
- spring boot配置mybatis和事务管理
- 【备忘】mybatis的条件判断用<choose>
- MyBatis 源代码阅读笔记 1 基于XML配置的代码编写 mybatis-config.xml
- SQL Server 将查询结果集以XML形式展现 for xml path
- MyBatis学习总结(二)——MyBatis核心配置文件与输入输出映射
- [DB][mybatis]MyBatis mapper文件引用变量#{}与${}差异
- Mybatis出现Parameter ‘XXX‘ not found. Available parameters are [0, 1, param1, param2]错误解决方法
- 【项目实战】MyBatis-Plus 配置属性介绍以及如何开启与关闭SQL日志打印
- Spring+SpringMVC+Mybatis(开发必备技能)04、mybatis自动生成mapper_dao_model(包含工具与视频讲解) 纯绿色版本、配套使用视频,100%运行成功
- idea中的插件之一:Free Mybatis Tool跳转插件的使用(方便在Dao接口和Mappper XML文件之间进行切换)
- mybatis-plus如何配置日志信息
- mybatis里mapper.xml中SQL语句if语句嵌套if语句