generator插件配置方式使用
generator插件配置方式使用
<build>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<configuration>
<configurationFile>${project.basedir}/src/main/resources/mybatis/generatorConfig.xml
</configurationFile>
</configuration>
</plugin>
</plugins>
</build>
generatorConfig.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<classPathEntry location="G:\action\flymybatis\src\main\resources\mybatis\mysql-connector-java-5.1.8.jar"/>
<context id="MysqlTables" targetRuntime="MyBatis3">
<!--去除注释 -->
<commentGenerator>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/mybatis"
userId="root"
password="root">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<javaModelGenerator targetPackage="mapper" targetProject="G:\action\flymybatis\src\main\java">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<sqlMapGenerator targetPackage="xml" targetProject="G:\action\flymybatis\src\main\resources">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<javaClientGenerator type="XMLMAPPER" targetPackage="mapper" targetProject="G:\action\flymybatis\src\main\java">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<table schema="mybatis" tableName="user" domainObjectName="User">
<property name="useActualColumnNames" value="false"/>
<!--<generatedKey column="ID" sqlStatement="DB2" identity="true"/>-->
<columnOverride column="DATE_FIELD" property="startDate"/>
<ignoreColumn column="FRED"/>
<columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR"/>
</table>
</context>
</generatorConfiguration>
还需要:
mybatis-generator-config_1_0.dtd
mysql-connector-java-5.1.8.jar
generator插件配置方式使用的更多相关文章
- Android Studio 三种添加插件的方式,androidstudio
前几篇blog我们介绍了如何安装和配置Android Studio,这篇Blog我们来聊聊如何给Android Studio添加插件,添加插件的路径有三种,我把他们分类如下: 点击设置小按钮 点击[P ...
- maven常用插件配置详解
常用插件配置详解Java代码 <!-- 全局属性配置 --> <properties> <project.build.name>tools</proje ...
- Gvim各种插件配置(windows环境下)
1.Vundle插件:https://github.com/gmarik/Vundle.vim 用于管理Vim插件,安装此插件需要系统中已安装git,参考链接:Git for Windows安装和基本 ...
- mybatis generator 插件安装及使用
现在Mybatis特别火,但是在开发中却要经常写实体类和配置文件,会不会特别烦人,所以可以利用Mybatis的代码生成插件来生成这部分代码: 1,打开eclipse,点击Help>Softwar ...
- 使用Mapper专用的MyBatis Generator插件
使用Maven执行MBG 这里有一个完整的例子,Mybatis-Spring,下面讲解的内容出自这个例子. 使用Maven插件的一个好处是可以将Maven中的属性使用${property}形式在gen ...
- vim学习、各类插件配置与安装
vim学习.各类插件配置与安装 vim 插件 配置 1. vim学习 vim基础学习:根据网上流行基础文章<简明Vim练级攻略>,进阶书籍<vim实用技巧>.注:进阶书籍可以在 ...
- 1、MyEclipse插件配置以及通过MyEclipse生成表对应的JPA代码
去除MyEclipse插件的方式是打开:WindowàCustomize Perspective窗口进行插件配置: 取出下图中不常用的插件勾,最终点击OK. 3.点击OK之后显示的效果图如下: ...
- Spring MVC 的 Java Config ( 非 XML ) 配置方式
索引: 开源Spring解决方案--lm.solution 参看代码 GitHub: solution/pom.xml web/pom.xml web.xml WebInitializer.java ...
- SpringBoot学习(二)-->Spring的Java配置方式
二.Spring的Java配置方式 Java配置是Spring4.x推荐的配置方式,可以完全替代xml配置. 1.@Configuration 和 @Bean Spring的Java配置方式是通过 @ ...
随机推荐
- mysql 语句根据身份证查询年龄,地址,性别
select case left(idcard,2) when '11' then '北京市'when '12' then '天津市'when '13' then '河北省'when '14' th ...
- 【性能测试工具ab】ab工具使用
1.在安装了apache服务器后,或者wampserver后,在bin目录下,有一个ab.exe文件 2.使用,进入ab.exe所在的文件夹 3.ab -c 10 -n 1000 htt ...
- 1-2Controller之Session
laravel5.5版本. 视频教程是慕课网中的:轻松学会Laravel-表单篇 1-2 /*session简介: 1.由于HTTP协议是无状态(Stateless)的,所以session提供一种保存 ...
- Uva LA 3177 - Beijing Guards 贪心,特例分析,判断器+二分,记录区间内状态数目来染色 难度: 3
题目 https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_pr ...
- Reveal 破解及使用
Reveal是一款很好的iOS调试应用,这在你的开发中起到了相当大的帮助. 破解包可去http://xclient.info/?_=118ba0724e7a6af91ba29a22ee4131da 下 ...
- eclipse搭建ssm框架
新建数据库ssm 建立数据库表user CREATE TABLE `user` ( `id` int(11) NOT NULL AUTO_INCREMENT , `sex` varchar(255) ...
- SQL-39 使用索引
题目描述 针对salaries表emp_no字段创建索引idx_emp_no,查询emp_no为10005, 使用强制索引.CREATE TABLE `salaries` (`emp_no` int( ...
- java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result异常的解决方法
今天在写一个JAVA程序的时候出现了异常:java.lang.ArithmeticException: Non-terminating decimal expansion; no exact repr ...
- 一个简单的JSP程序示例
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"% ...
- 开发中最好使用not exists 取代not in
开发中使用not in可能会存在致命的错误,在子查询中,如果存在空值,not in返回的数据就是空了,如下创建2张数据表: user表: 部门表: 现在要查询没有分配到用户的部门有哪些,使用not i ...