mybatis generate 自动生成 entity dao 和 xml 文件
其中的一种方式 ,使用maven 插件
<build>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
<executions>
<execution>
<id>Generate MyBatis Artifacts</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.30</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<?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="C:/Oracle/Middleware/wlserver_10.3/server/lib/ojdbc6.jar"/> -->
<context id="my" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressDate" value="false"/>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/drtest?characterEncoding=utf-8" userId=" "
password=" "/> <javaModelGenerator targetPackage="foo"
targetProject="D:/workspace/zzzz-core/src/main/java">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator> <sqlMapGenerator targetPackage="foo"
targetProject="D:/workspace/zzzz-core/src/main/java">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator> <javaClientGenerator targetPackage="foo"
targetProject="D:/workspace/zzzz-core/src/main/java" type="XMLMAPPER">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator> <!--<table tableName="T_FEE_AGTBILL" domainObjectName="FeeAgentBill"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false"/>--> <table tableName="hf_user" domainObjectName="HfUser"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
<!--<columnRenamingRule searchString="^D_"
replaceString=""/>-->
</table> </context>
</generatorConfiguration>
mybatis generate 自动生成 entity dao 和 xml 文件的更多相关文章
- Springboot mybatis generate 自动生成实体类和Mapper
https://github.com/JasmineQian/SpringDemo_2019/tree/master/mybatis Springboot让java开发变得方便,Springboot中 ...
- Mybatis 如何自动生成bean dao xml 配置文件 generatorconfig.xml (mysql)
1/自动生成的jar包:mybatis-generator-core-1.3.2.jar 2/generatorconfig.xml文件如: <?xml version="1.0& ...
- Mybatis 如何自动生成bean dao xml 配置文件 generatorconfig.xml (main()方法自动生成更快捷)
最近项目要用到mybatis中间件,中间涉及到要对表结构生成bean,dao,和sqlconfig.xml 所以记录一下学习过程 首先是准备工作,即准备需要的jar包:我们的数据库mysql,所以驱动 ...
- java web(七): mybatis的动态sql和mybatis generator自动生成pojo类和映射文件
前言: MyBatis 的强大特性之一便是它的动态 SQL.如果你有使用 JDBC 或其它类似框架的经验,你就能体会到根据 不同条件拼接 SQL 语句的痛苦.例如拼接时要确保不能忘记添加必要的空格,还 ...
- 如何自动生成 Entity Framework 的 Mapping 文件?
Program.cs using System; using System.IO; using System.Text; using System.Text.RegularExpressions; n ...
- 【Mybatis】使用Mybatis-Generator自动生成entity、dao、mapping
使用过mybatis的应该都有用过Mybatis-Generator,本文主要介绍使用Mybatis-Generator来自动生成entity.dao.mapping文件. Mybatis-Gener ...
- MyBatis 使用Generator自动生成Model , Dao, mapper
最近 我新建了一 个maven 项目,使用的是spring + springmvc + mybatis框架. 听说Mybatis可以自动生成model和mapper以及dao层,我就从网上查了查资 ...
- (二十二)SpringBoot之使用mybatis generator自动生成bean、mapper、mapper xml
一.下载mybatis generator插件 二.生成generatorConfig.xml new一个generatorConfig.xml 三.修改generatorConfig.xml 里面的 ...
- Springboot 系列(十一)使用 Mybatis(自动生成插件) 访问数据库
1. Springboot mybatis 介绍 MyBatis 是一款优秀的持久层框架,它支持定制化 SQL.存储过程以及高级映射.MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数获取 ...
随机推荐
- git初始化
git init:初始化 git status:查看当前目录下文件状态 git add -A(表示添加当前目录下所有文件)/文件名(表示只添加该一个文件) git commit -m '':提交到本地 ...
- Javascript 基础知识学习--javascript中的参数传递都是按值传递的
ECMAScript中所有函数的参数传递都是按值传递的,无论参数是值类型还是引用类型的.过去我跟大多数人一样觉得跟传值类型相关. 自己写了一个测试的例子,确实如此 function add(a) { ...
- study topics
永远不变的东西,原理 study roadmap: 1.user space: tizen power manager => suspend/resume or runtime? android ...
- delphi控件属性和事件
常用[属性] Action:该属性是与组件关联的行为,允许应用程序集中响应用户命令 Anchors:与组件连接的窗体的位置点 Align:确定组件的对齐方式 AutoSize:确定组件是否自动 ...
- mysql存储过程简介
创建存储过程CREATE PROCEDURE productpricing(OUT pl DECIMAL(8,2),OUT ph DECIMAL(8,2),OUT pa DECIMAL(8,2))BE ...
- 关于新闻,在线编辑器建表时此字段一定要为text
create table about( content text )engine=myisam default charset=utf8; 项目的各个建表语句 create database day4 ...
- Hue整合Sqoop报空指针异常的解决方法
hue是一个Apache基金会下的一个开源图形化管理工具,使用python语言开发,使用的框架是Django.而sqoop也是Apache的一个开源工具,是使用Java语言开发,主要用于进行hdfs和 ...
- ffmpeg去logo<转>
用到 video filter —— delogo 通过周围像素插值去除 logo. 参数介绍: x y (必须)指定 logo 的坐标. w h (必须)指定 logo 的宽和高. band, t ...
- Python自动化 【第八篇】:Python基础-Socket编程进阶
本节内容: Socket语法及相关 SocketServer实现多并发 1. Socket语法及相关 sk = socket.socket(socket.AF_INET,socket.SOCK_STR ...
- centos 6 initctl
在centos6中有initctl 可以启动tty等.此命令在 upstart-0.6.5-10.el6.x86_64 rpm包中 或者 mingetty 命令启动 tty #initctl star ...