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 ...
随机推荐
- vscode安装golang插件失败问题
vscode安装golang插件失败问题 dlv go-outline go-symbols gocode-gomod gocode 代码补全 godef 代码跳转 golint gopkgs gor ...
- unity2018使用tileMap生成地图 类似泰拉瑞亚创建和销毁地图块
参考网站:https://blog.csdn.net/pz789as/article/details/79540890 using System.Collections; using System.C ...
- spring 配置文件被加载两次
如下web.xml示例: 1.用spring的配置加载contextConfigLocation 2.配置spring-mvc的contextConfigLocation <servlet> ...
- 用.net 2.0(或.net 3.5)开发的程序在.net 4.0的环境中运行的解决方案
引用:.NET2.0程序集无法在.net 4.0 中运行的解决方案 1. 原来是在.net 2.0 (VS2008)的环境下的程序,通过升级到.net 4.0 (VS2013)导致程序运行不了 提示需 ...
- linux 查看某几行内容与文件分割
查看指定行数 sed -n 4,8p file #打印file中的4-8行 sed -n 4p file #打印file中的第4行 grep ^pw file # 查看file中以pw开头的行 在Li ...
- 架构实战项目心得(十):基于spring-ladp的统一用户中心结构设计以及代码结构设计
一.目录设计 1 公司 2 部门 3 注册人员 4 层级人员 二.规则 1 注册 自行注册人员放到模拟公司的目录下,等所属公司组织结构建立完毕,将此人员迁移到所属公司(或者删除此人员,所属公司新建此人 ...
- 架构实战项目心得(六):后台服务nosql数据库mongodb
一.架构介绍 mongodb有几种部署方式,这里采用的是副本集架构(Replica Set). 为了防止单点故障就需要引副本(Replication),当发生硬件故障或者其 ...
- Firebird 列可空非空修改
2018-12-04 至少到Firebird 3.0.4 已经添加了设置可空 和 非空的语法:如 -- 删除非空(设置为可空) ALTER TABLE TECH ALTER label drop NO ...
- Chetsheet: 2017 01.01 ~ 01.31
Web TypeScript: the missing introduction Async HTTP API and service bus Optimizing the Performance o ...
- 初步理解impress.js
1.认识impress.js impress.js 采用 CSS3 与 JavaScript 语言完成的一个可供开发者使用的表现层框架(演示工具). 现在普通开发者可以利用 impress.js 自己 ...