myEclipse mybatis自动生成工具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>
<context id="ID " defaultModelType="flat">
<jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver" connectionURL="jdbc:sqlserver://地址:端口;DatabaseName=数据库名称" userId="用户名" password="密码" />
<javaModelGenerator targetPackage="com.包名.entity.main" targetProject="存放项目名称" />
<sqlMapGenerator targetPackage="com.包名.dao.main.mapping.sqlserver" targetProject="存放项目名称" />
<javaClientGenerator targetPackage="com.包名.dao.main" targetProject="存放项目名称" type="XMLMAPPER" />
<table tableName="表名称(与数据库同步)" enableCountByExample="flase" enableUpdateByExample="flase" enableDeleteByExample="flase" enableSelectByExample="flase" selectByExampleQueryId="flase"></table>
</context>
</generatorConfiguration>
例子:
<?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>
<context id="sky" defaultModelType="flat">
<jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver" connectionURL="jdbc:sqlserver://192.168.0.66:1433;DatabaseName=database1" userId="admin" password="123sky3" />
<javaModelGenerator targetPackage="com.sky.demo.other.entity.main" targetProject="demo-other-main" />
<sqlMapGenerator targetPackage="com.sky.demo.other.dao.main.mapping.sqlserver" targetProject="demo-other-main" />
<javaClientGenerator targetPackage="com.sky.demo.other.dao.main" targetProject="demo-other-main" type="XMLMAPPER" />
<table tableName="u_student" enableCountByExample="flase" enableUpdateByExample="flase" enableDeleteByExample="flase" enableSelectByExample="flase" selectByExampleQueryId="flase"></table>
</context>
</generatorConfiguration>
myEclipse mybatis自动生成工具xml配置的更多相关文章
- mybatis generator配置,Mybatis自动生成文件配置,Mybatis自动生成实体Bean配置
mybatis generator配置,Mybatis自动生成文件配置,Mybatis自动生成实体Bean配置 ============================== 蕃薯耀 2018年3月14 ...
- Mybatis自动生成实体类
Maven自动生成实体类需要的jar包 一.pom.xml中 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns ...
- 一步步学Mybatis-告别繁琐的配置之Mybatis配置文件生成工具 (7)
今年是2013年的杀青之日,前几天由于比较忙,没有及时更新本篇的最后一篇东西,前六篇中我们主要都是采用手动配置相关的Mybatis映射文件与相应的接口类与实体类.当然如果在真正的使用过程中,由于业务的 ...
- mybatis自动生成model、dao及对应的mapper.xml文件
背景: 日常开发中,如果新建表,手动敲写model.dao和对应的mapper.xml文件,费时费力且容易出错, 所以采用mybatis自动生成model.dao及对应的mapper.xml文件.代码 ...
- mybatis使用注解替代xml配置,动态生成Sql
mybatis使用注解替代xml配置时,遇到判断条件是否为null或者为空时,@Select很难搞定,不知道怎么办? mybatis3中增加了使用注解来配置Mapper的新特性,使用 SelectPr ...
- mybatis自动生成代码工具(逆向工程)
MyBatis自动生成实体类(逆向工程) MyBatis属于一种半自动的ORM框架,它需要我们自己编写sql语句和映射文件,但是编写映射文件和sql语句很容易出错,所以mybatis官方提供了Gene ...
- mybatis自动生成java代码
SSM框架没有DB+Record模式,写起来特别费劲,只能用下面的方法勉强凑合. 上图中,*.jar为下载的,src为新建的空白目录,.xml配置如下. <?xml version=" ...
- Mybatis自动生成的BO对象继承公共父类(BO中过滤掉公共属性)
使用mybatis的代码生成工具:mybatis-generator,如果自动生成的BO都有公共的属性,则可以指定这些BO继承父类(父类中定义公共属性) 1.定义父类 注意:属性public,不要使用 ...
- mybatis自动生成代码插件mybatis-generator使用流程(亲测可用)
mybatis-generator是一款在使用mybatis框架时,自动生成model,dao和mapper的工具,很大程度上减少了业务开发人员的手动编码时间 坐着在idea上用maven构建spri ...
随机推荐
- mysql编码不统一形成的错误
错误提示:[Err]1267 - Illegal mix of collations(utf8_general_ci,IMPLICIT) and (utf8_unicode_ci,IMPLICIT) ...
- 3dsmax2016卸载/安装失败/如何彻底卸载清除干净3dsmax2016注册表和文件的方法
3dsmax2016提示安装未完成,某些产品无法安装该怎样解决呢?一些朋友在win7或者win10系统下安装3dsmax2016失败提示3dsmax2016安装未完成,某些产品无法安装,也有时候想重新 ...
- (转)linux exec与重定向
原文:http://xstarcd.github.io/wiki/shell/exec_redirect.html linux exec与重定向 exec和source都属于bash内部命令(buil ...
- 【c++】explicit 隐式类类型转换
上代码 #include <iostream> #include <sstream> using namespace std; class A { public: A(cons ...
- Map.Entry遍历集合中的元素
Entry是Map中的一个内部累,map.entrySet()可以得到key和value的视图给你一个比较简单的小事例public static void main(String[] args) { ...
- Angular4 step by step.2
1.使用CLI命令生成的项目,直接把css ,和 template 给独立到文件中了,看着 `` 扎眼 哇咔咔 2.项目效果图:
- 基于语法分析器GOLD Parser开发的数学表达式计算器
最近发现一款文法分析神器,看完官网(http://goldparser.org/)的介绍后感觉很犀利的样子,于是就拿来测试了一番,写了一个数学表达式分析的小程序,支持的数学运算符如下所示:常规运算:+ ...
- golang 使用rrd的相关资料
一.简介 RRDtool是指Round Robin Database工具,即环状数据库.从功能上说,RRDtool可用于数据存储+数据展示.著名的网络流量绘图软件MRTG和集群监控系统Gan ...
- UVA 10328(DP,大数,至少连续)
http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=19825 这道题和http://www.cnblogs.com/qlky/p/ ...
- 第八章.Java集合
Java集合类是一种特别有用的工具类,可用于存储数量不等的对象.Java集合大致可分为Set.List.Queue和Map四种体系 Set代表无序.不可重复的集合 List代表有序.重复的集合 Map ...