首先,工作中一直在使用命令方式的mybatis的代码自动生成,今天把自己的笔记本直接搞一个在eclipse中生成的逆向代码生成工程,方便自己在家学习使用,在搞这个工程的过程中由于自己搞了一套环境,所i出现了一些问题,最后解决了,在这里首先写出来,给自己提个醒

  出的问题主要是在下载代码生成的jar时和逆向生成代码时出的问题

  本博主因为自己在linux centos上搞了一套私服,打算以后一直采用这个,所以在jar时因为忘了这个事,所以jar没有下载出来,以后一定要先把私服打开,连上网,同时关闭防火墙

  第二,就是逆向代码生成报错,可以先编译一下,在生成,如果还不行就去认真检查generatorConfig.xml是否有配错的地方。

接着我们上代码

我们创建mybatis-generator的springboot工程,这里面可以删除逆向工程不需要的运行主程序和测试主程序以及测试资源包等结构i,然后就是配置了

pom文件

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.zxy</groupId>
<artifactId>mybatis-generator</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging> <name>mybatis-generator</name>
<description>Forward project for Spring Boot</description> <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- 数据库==================================以下部分为生成代码需要的===================================================== -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.4.6</version>
</dependency> <!-- 自动生成代码依赖 -->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency> </dependencies> <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.5</version>
<!-- 配置依赖的数据库 -->
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47</version>
</dependency>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency>
</dependencies>
<configuration>
<!-- 配置generator.xml文件的路径 -->
<configurationFile>${basedir}/src/main/resources/generatorConfig.xml</configurationFile>
<overwrite>true</overwrite>
</configuration>
</plugin>
</plugins>
</build> </project>

generatorConfig.xml放在src/main/resources下

<?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="test" targetRuntime="MyBatis3">
<plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin"></plugin>
<plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
<plugin type="org.mybatis.generator.plugins.ToStringPlugin"></plugin>
<commentGenerator>
<!-- 这个元素用来去除指定生成的注释中是否包含生成的日期 false:表示保护 -->
<!-- 如果生成日期,会造成即使修改一个字段,整个实体类所有属性都会发生变化,不利于版本控制,所以设置为true -->
<property name="suppressDate" value="true" />
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!--数据库链接URL,用户名、密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/ssm" userId="root" password="123456">
</jdbcConnection>
<javaTypeResolver>
<!-- This property is used to specify whether MyBatis Generator should
force the use of java.math.BigDecimal for DECIMAL and NUMERIC fields, -->
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- 生成模型的包名和位置 -->
<javaModelGenerator targetPackage="com.zxy.dealer.entity"
targetProject="src/main/java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- 生成映射文件的包名和位置 -->
<sqlMapGenerator targetPackage="mapper"
targetProject="src/main/resources">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!-- 生成DAO的包名和位置 -->
<javaClientGenerator type="XMLMAPPER"
targetPackage="com.zxy.dealer.dao" targetProject="src/main/java">
<property name="enableSubPackages" value="true" />
</javaClientGenerator> <!-- 要生成哪些表 -->
<table tableName="goods" domainObjectName="Goods"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>

然后就可以运行了,运行命令:mybatis-generator:generate

生成后的目录结构

生成的代码如下:

entity

 package com.zxy.dealer.entity;

 import java.io.Serializable;
import java.util.Date; public class Goods implements Serializable {
private Integer id; private String goodsname; private Integer billstatus; private Integer goodsdistric; private Double goodsprice; private Integer goodscount; private Date creationtime; private static final long serialVersionUID = 1L; public Integer getId() {
return id;
} public void setId(Integer id) {
this.id = id;
} public String getGoodsname() {
return goodsname;
} public void setGoodsname(String goodsname) {
this.goodsname = goodsname == null ? null : goodsname.trim();
} public Integer getBillstatus() {
return billstatus;
} public void setBillstatus(Integer billstatus) {
this.billstatus = billstatus;
} public Integer getGoodsdistric() {
return goodsdistric;
} public void setGoodsdistric(Integer goodsdistric) {
this.goodsdistric = goodsdistric;
} public Double getGoodsprice() {
return goodsprice;
} public void setGoodsprice(Double goodsprice) {
this.goodsprice = goodsprice;
} public Integer getGoodscount() {
return goodscount;
} public void setGoodscount(Integer goodscount) {
this.goodscount = goodscount;
} public Date getCreationtime() {
return creationtime;
} public void setCreationtime(Date creationtime) {
this.creationtime = creationtime;
} @Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
Goods other = (Goods) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getGoodsname() == null ? other.getGoodsname() == null : this.getGoodsname().equals(other.getGoodsname()))
&& (this.getBillstatus() == null ? other.getBillstatus() == null : this.getBillstatus().equals(other.getBillstatus()))
&& (this.getGoodsdistric() == null ? other.getGoodsdistric() == null : this.getGoodsdistric().equals(other.getGoodsdistric()))
&& (this.getGoodsprice() == null ? other.getGoodsprice() == null : this.getGoodsprice().equals(other.getGoodsprice()))
&& (this.getGoodscount() == null ? other.getGoodscount() == null : this.getGoodscount().equals(other.getGoodscount()))
&& (this.getCreationtime() == null ? other.getCreationtime() == null : this.getCreationtime().equals(other.getCreationtime()));
} @Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getGoodsname() == null) ? 0 : getGoodsname().hashCode());
result = prime * result + ((getBillstatus() == null) ? 0 : getBillstatus().hashCode());
result = prime * result + ((getGoodsdistric() == null) ? 0 : getGoodsdistric().hashCode());
result = prime * result + ((getGoodsprice() == null) ? 0 : getGoodsprice().hashCode());
result = prime * result + ((getGoodscount() == null) ? 0 : getGoodscount().hashCode());
result = prime * result + ((getCreationtime() == null) ? 0 : getCreationtime().hashCode());
return result;
} @Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", goodsname=").append(goodsname);
sb.append(", billstatus=").append(billstatus);
sb.append(", goodsdistric=").append(goodsdistric);
sb.append(", goodsprice=").append(goodsprice);
sb.append(", goodscount=").append(goodscount);
sb.append(", creationtime=").append(creationtime);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

dao

 package com.zxy.dealer.dao;

 import com.zxy.dealer.entity.Goods;

 public interface GoodsMapper {
int deleteByPrimaryKey(Integer id); int insert(Goods record); int insertSelective(Goods record); Goods selectByPrimaryKey(Integer id); int updateByPrimaryKeySelective(Goods record); int updateByPrimaryKey(Goods record);
}

mapper

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zxy.dealer.dao.GoodsMapper">
<resultMap id="BaseResultMap" type="com.zxy.dealer.entity.Goods">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="goodsName" jdbcType="VARCHAR" property="goodsname" />
<result column="billStatus" jdbcType="INTEGER" property="billstatus" />
<result column="goodsDistric" jdbcType="INTEGER" property="goodsdistric" />
<result column="goodsPrice" jdbcType="DOUBLE" property="goodsprice" />
<result column="goodsCount" jdbcType="INTEGER" property="goodscount" />
<result column="creationTime" jdbcType="DATE" property="creationtime" />
</resultMap>
<sql id="Base_Column_List">
id, goodsName, billStatus, goodsDistric, goodsPrice, goodsCount, creationTime
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from goods
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from goods
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.zxy.dealer.entity.Goods">
insert into goods (id, goodsName, billStatus,
goodsDistric, goodsPrice, goodsCount,
creationTime)
values (#{id,jdbcType=INTEGER}, #{goodsname,jdbcType=VARCHAR}, #{billstatus,jdbcType=INTEGER},
#{goodsdistric,jdbcType=INTEGER}, #{goodsprice,jdbcType=DOUBLE}, #{goodscount,jdbcType=INTEGER},
#{creationtime,jdbcType=DATE})
</insert>
<insert id="insertSelective" parameterType="com.zxy.dealer.entity.Goods">
insert into goods
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="goodsname != null">
goodsName,
</if>
<if test="billstatus != null">
billStatus,
</if>
<if test="goodsdistric != null">
goodsDistric,
</if>
<if test="goodsprice != null">
goodsPrice,
</if>
<if test="goodscount != null">
goodsCount,
</if>
<if test="creationtime != null">
creationTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="goodsname != null">
#{goodsname,jdbcType=VARCHAR},
</if>
<if test="billstatus != null">
#{billstatus,jdbcType=INTEGER},
</if>
<if test="goodsdistric != null">
#{goodsdistric,jdbcType=INTEGER},
</if>
<if test="goodsprice != null">
#{goodsprice,jdbcType=DOUBLE},
</if>
<if test="goodscount != null">
#{goodscount,jdbcType=INTEGER},
</if>
<if test="creationtime != null">
#{creationtime,jdbcType=DATE},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.zxy.dealer.entity.Goods">
update goods
<set>
<if test="goodsname != null">
goodsName = #{goodsname,jdbcType=VARCHAR},
</if>
<if test="billstatus != null">
billStatus = #{billstatus,jdbcType=INTEGER},
</if>
<if test="goodsdistric != null">
goodsDistric = #{goodsdistric,jdbcType=INTEGER},
</if>
<if test="goodsprice != null">
goodsPrice = #{goodsprice,jdbcType=DOUBLE},
</if>
<if test="goodscount != null">
goodsCount = #{goodscount,jdbcType=INTEGER},
</if>
<if test="creationtime != null">
creationTime = #{creationtime,jdbcType=DATE},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zxy.dealer.entity.Goods">
update goods
set goodsName = #{goodsname,jdbcType=VARCHAR},
billStatus = #{billstatus,jdbcType=INTEGER},
goodsDistric = #{goodsdistric,jdbcType=INTEGER},
goodsPrice = #{goodsprice,jdbcType=DOUBLE},
goodsCount = #{goodscount,jdbcType=INTEGER},
creationTime = #{creationtime,jdbcType=DATE}
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap id="BaseResultMap" type="com.zxy.dealer.entity.Goods">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="goodsName" jdbcType="VARCHAR" property="goodsname" />
<result column="billStatus" jdbcType="INTEGER" property="billstatus" />
<result column="goodsDistric" jdbcType="INTEGER" property="goodsdistric" />
<result column="goodsPrice" jdbcType="DOUBLE" property="goodsprice" />
<result column="goodsCount" jdbcType="INTEGER" property="goodscount" />
<result column="creationTime" jdbcType="DATE" property="creationtime" />
</resultMap>
<sql id="Base_Column_List">
id, goodsName, billStatus, goodsDistric, goodsPrice, goodsCount, creationTime
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from goods
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from goods
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.zxy.dealer.entity.Goods">
insert into goods (id, goodsName, billStatus,
goodsDistric, goodsPrice, goodsCount,
creationTime)
values (#{id,jdbcType=INTEGER}, #{goodsname,jdbcType=VARCHAR}, #{billstatus,jdbcType=INTEGER},
#{goodsdistric,jdbcType=INTEGER}, #{goodsprice,jdbcType=DOUBLE}, #{goodscount,jdbcType=INTEGER},
#{creationtime,jdbcType=DATE})
</insert>
<insert id="insertSelective" parameterType="com.zxy.dealer.entity.Goods">
insert into goods
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="goodsname != null">
goodsName,
</if>
<if test="billstatus != null">
billStatus,
</if>
<if test="goodsdistric != null">
goodsDistric,
</if>
<if test="goodsprice != null">
goodsPrice,
</if>
<if test="goodscount != null">
goodsCount,
</if>
<if test="creationtime != null">
creationTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="goodsname != null">
#{goodsname,jdbcType=VARCHAR},
</if>
<if test="billstatus != null">
#{billstatus,jdbcType=INTEGER},
</if>
<if test="goodsdistric != null">
#{goodsdistric,jdbcType=INTEGER},
</if>
<if test="goodsprice != null">
#{goodsprice,jdbcType=DOUBLE},
</if>
<if test="goodscount != null">
#{goodscount,jdbcType=INTEGER},
</if>
<if test="creationtime != null">
#{creationtime,jdbcType=DATE},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.zxy.dealer.entity.Goods">
update goods
<set>
<if test="goodsname != null">
goodsName = #{goodsname,jdbcType=VARCHAR},
</if>
<if test="billstatus != null">
billStatus = #{billstatus,jdbcType=INTEGER},
</if>
<if test="goodsdistric != null">
goodsDistric = #{goodsdistric,jdbcType=INTEGER},
</if>
<if test="goodsprice != null">
goodsPrice = #{goodsprice,jdbcType=DOUBLE},
</if>
<if test="goodscount != null">
goodsCount = #{goodscount,jdbcType=INTEGER},
</if>
<if test="creationtime != null">
creationTime = #{creationtime,jdbcType=DATE},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zxy.dealer.entity.Goods">
update goods
set goodsName = #{goodsname,jdbcType=VARCHAR},
billStatus = #{billstatus,jdbcType=INTEGER},
goodsDistric = #{goodsdistric,jdbcType=INTEGER},
goodsPrice = #{goodsprice,jdbcType=DOUBLE},
goodsCount = #{goodscount,jdbcType=INTEGER},
creationTime = #{creationtime,jdbcType=DATE}
where id = #{id,jdbcType=INTEGER}
</update>
<resultMap id="BaseResultMap" type="com.zxy.dealer.entity.Goods">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="goodsName" jdbcType="VARCHAR" property="goodsname" />
<result column="billStatus" jdbcType="INTEGER" property="billstatus" />
<result column="goodsDistric" jdbcType="INTEGER" property="goodsdistric" />
<result column="goodsPrice" jdbcType="DOUBLE" property="goodsprice" />
<result column="goodsCount" jdbcType="INTEGER" property="goodscount" />
<result column="creationTime" jdbcType="DATE" property="creationtime" />
</resultMap>
<sql id="Base_Column_List">
id, goodsName, billStatus, goodsDistric, goodsPrice, goodsCount, creationTime
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from goods
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from goods
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.zxy.dealer.entity.Goods">
insert into goods (id, goodsName, billStatus,
goodsDistric, goodsPrice, goodsCount,
creationTime)
values (#{id,jdbcType=INTEGER}, #{goodsname,jdbcType=VARCHAR}, #{billstatus,jdbcType=INTEGER},
#{goodsdistric,jdbcType=INTEGER}, #{goodsprice,jdbcType=DOUBLE}, #{goodscount,jdbcType=INTEGER},
#{creationtime,jdbcType=DATE})
</insert>
<insert id="insertSelective" parameterType="com.zxy.dealer.entity.Goods">
insert into goods
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="goodsname != null">
goodsName,
</if>
<if test="billstatus != null">
billStatus,
</if>
<if test="goodsdistric != null">
goodsDistric,
</if>
<if test="goodsprice != null">
goodsPrice,
</if>
<if test="goodscount != null">
goodsCount,
</if>
<if test="creationtime != null">
creationTime,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="goodsname != null">
#{goodsname,jdbcType=VARCHAR},
</if>
<if test="billstatus != null">
#{billstatus,jdbcType=INTEGER},
</if>
<if test="goodsdistric != null">
#{goodsdistric,jdbcType=INTEGER},
</if>
<if test="goodsprice != null">
#{goodsprice,jdbcType=DOUBLE},
</if>
<if test="goodscount != null">
#{goodscount,jdbcType=INTEGER},
</if>
<if test="creationtime != null">
#{creationtime,jdbcType=DATE},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.zxy.dealer.entity.Goods">
update goods
<set>
<if test="goodsname != null">
goodsName = #{goodsname,jdbcType=VARCHAR},
</if>
<if test="billstatus != null">
billStatus = #{billstatus,jdbcType=INTEGER},
</if>
<if test="goodsdistric != null">
goodsDistric = #{goodsdistric,jdbcType=INTEGER},
</if>
<if test="goodsprice != null">
goodsPrice = #{goodsprice,jdbcType=DOUBLE},
</if>
<if test="goodscount != null">
goodsCount = #{goodscount,jdbcType=INTEGER},
</if>
<if test="creationtime != null">
creationTime = #{creationtime,jdbcType=DATE},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.zxy.dealer.entity.Goods">
update goods
set goodsName = #{goodsname,jdbcType=VARCHAR},
billStatus = #{billstatus,jdbcType=INTEGER},
goodsDistric = #{goodsdistric,jdbcType=INTEGER},
goodsPrice = #{goodsprice,jdbcType=DOUBLE},
goodsCount = #{goodscount,jdbcType=INTEGER},
creationTime = #{creationtime,jdbcType=DATE}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

主要生成了根据主键查找、删除,查找全部及动态增改和非动态增改共7个方法,很好用!

eclipse生成mybatis的逆向工程-mybatis代码自动生成的更多相关文章

  1. webservice 服务端例子+客户端例子+CXF整合spring服务端测试+生成wsdl文件 +cxf客户端代码自动生成

    首先到CXF官网及spring官网下载相关jar架包,这个不多说.webservice是干嘛用的也不多说. 入门例子 模拟新增一个用户,并返回新增结果,成功还是失败. 大概的目录如上,很简单. Res ...

  2. Mybaits-Maven项目之逆向工程(代码自动生成)

    1.添加maven插件,让maven环境支持mybatis-generator组件 在pom.xml里面添加如下代码: <project xmlns="http://maven.apa ...

  3. 基于eclipse的mybatis映射代码自动生成的插件

    基于eclipse的mybatis映射代码自动生成的插件 分类: JAVA 数据库 工具相关2012-04-29 00:15 2157人阅读 评论(9) 收藏 举报 eclipsegeneratori ...

  4. 基于eclipse的mybatis映射代码自动生成的插件http://blog.csdn.net/fu9958/article/details/7521681

    基于eclipse的mybatis映射代码自动生成的插件 分类: JAVA 数据库 工具相关2012-04-29 00:15 2157人阅读 评论(9) 收藏 举报 eclipsegeneratori ...

  5. MyBatis代码自动生成

    MyBatis的代码自动生成的功能,由于MyBatis属于一种半自动的ORM框架,所以主要的工作就是配置Mapping映射文件,但是由于手写映射文件很容易出错,所以可利用MyBatis生成器自动生成实 ...

  6. Mybatis最入门---代码自动生成(generatorConfig.xml配置)

    [一步是咫尺,一步即天涯] 经过前文的叙述,各位看官是不是已经被Mybatis的强大功能给折服了呢?本文我们将介绍一个能够极大提升我们开发效率的插件:即代码自动生成.这里的代码自动生成包括,与数据库一 ...

  7. Mybatis 代码自动生成(generatorConfig.xml配置)

    博客推荐: Mybatis最入门---代码自动生成(generatorConfig.xml配置) MyBatis Generator generatorConfig.xml配置详解 pom.xml&l ...

  8. MyBatis Generator作为maven插件自动生成增删改查代码及配置文件例子

    什么是MyBatis Generator MyBatis Generator (MBG) 是一个Mybatis的代码生成器,可以自动生成一些简单的CRUD(插入,查询,更新,删除)操作代码,model ...

  9. Spring Boot (七)MyBatis代码自动生成和辅助插件

    一.简介 1.1 MyBatis Generator介绍 MyBatis Generator 是MyBatis 官方出品的一款,用来自动生成MyBatis的 mapper.dao.entity 的框架 ...

随机推荐

  1. Python之时间和日期模块

    1.import time 先要导入时间模块 1)time.time()得到当前的时间,返回的是时间戳,表示自1970年1月1日起到程序运行时的秒数 import time print(time.ti ...

  2. ThinkPHP5 动态生成图片缩略图

    需求场景 不同终端(PC端.手机端.平板),不同界面(列表页.详情页),对图片大小的要求不一样, 如果所有场景下都使用同一尺寸的图片,势必对会网络带宽及服务器性能造成一定的影响,由此需要服务器端能够根 ...

  3. Linux下清空文件的3种方法

    1.echo -n > test.log #-n选项可以去掉空行 2.cat /dev/null > test.log 3.truncate -s 0 test.log

  4. [转]轻松理解AOP思想(面向切面编程)

    原文链接 Spring是什么 先说一个Spring是什么吧,大家都是它是一个框架,但框架这个词对新手有点抽象,以致于越解释越模糊,不过它确实是个框架的,但那是从功能的角度来定义的,从本质意义上来讲,S ...

  5. 4-form表单的双向绑定

    概念:表单中的input框等其他标签,值变化时会触发函数,改变state中的值,反过来修改state中的值也会改变input框中值的展现 实现:利用类组件里的state属性来实现(setState会再 ...

  6. WebVR大潮来袭时,前端开发能做些什么

    WebVR大潮来袭时,前端开发能做些什么?     WebVR即web + VR的体验方式,我们可以戴着头显享受沉浸式的网页,新的API标准让我们可以使用js语言来开发.本文将介绍如何快速开发一个We ...

  7. HIHOcoder编程总结

    [Offer收割]编程练习赛44 对于第一题题目1 : 扫雷游戏,首先要想清楚思路,虽然是暴力算法,但是这八个方向要自己把坐标写正确,不要慌乱,自己写的时候就写错了一个,第二个就是判断的时候,j + ...

  8. web前端面试第一次[addEventListenr();绑定事件]

    //当一个元素同时处理多个函数,这里使用按钮 //addEventListener(string类型,处理函数,boolean); <input type="button" ...

  9. 「NOIP2009」Hankson的趣味题

    题目描述 (由于本题是数论题,所以我只把题目大意说一下...) 输入时给定\(a_0,a_1,b_0,b_1\),题目要求你求出满足如下条件的\(x\)的个数: \[\begin{cases}\gcd ...

  10. ASP.NET MVC4 Web项目中使用Log4Net记录日志到文件和数据库。

    下载与.netframework版本向对应的log4net.dll ,然后添加引用.下载地址:http://logging.apache.org/log4net/download_log4net.cg ...