版权声明:欢迎转载,请附加转载来源:一路博客(http://www.16boke.com)
由于MyBatis属于一种半自动的ORM框架,所以主要的工作将是书写Mapping映射文件,但是由于手写映射文件很容易出错,所以查资料发现有现成的工具可以自动生成底层模型类、Dao接口类甚至Mapping映射文件。
一、建立表结构
CREATE TABLE `user` (
`id` varchar(50) NOT NULL,
`username` varchar(18) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`password` varchar(18) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`name` varchar(18) DEFAULT NULL,
`sex` varchar(2) DEFAULT NULL,
`birthday` varchar(50) DEFAULT NULL,
`address` varchar(500) DEFAULT NULL,
`tel` varchar(18) DEFAULT NULL,
`qq` varchar(18) DEFAULT NULL,
`image` varchar(50) DEFAULT NULL,
`sfjh` varchar(1) DEFAULT NULL,
`sfzx` varchar(1) DEFAULT NULL,
`sfhf` varchar(1) DEFAULT NULL,
`sfpl` varchar(1) DEFAULT NULL,
`sffx` varchar(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf-8;
二、下载mybatis-generator-core
进入:http://code.google.com/p/mybatis/
选择Downloads,再选择MyBatis Generator Tool下载即可。
三、生成配置文件
新建一个空的XML配置文件,名称可以随便取,这里以generatorConfig.xml为名。最好将这个文件放在下载后的lib目录中,如图:
其中MySQL的驱动可以随便放在非中文路径的地方,这里为了方便就放在lib目录下。
自动生成最重要的就是配置文件的书写,现在就开始介绍generatorConfig.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>
- <!-- 数据库驱动-->
- <classPathEntry location="mysql-connector-java-5.0.6-bin.jar"/>
- <context id="DB2Tables" targetRuntime="MyBatis3">
- <commentGenerator>
- <property name="suppressDate" value="true"/>
- <!-- 是否去除自动生成的注释 true:是 : false:否 -->
- <property name="suppressAllComments" value="true"/>
- </commentGenerator>
- <!--数据库链接URL,用户名、密码 -->
- <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost/test" userId="test" password="test">
- </jdbcConnection>
- <javaTypeResolver>
- <property name="forceBigDecimals" value="false"/>
- </javaTypeResolver>
- <!-- 生成模型的包名和位置-->
- <javaModelGenerator targetPackage="test.model" targetProject="src">
- <property name="enableSubPackages" value="true"/>
- <property name="trimStrings" value="true"/>
- </javaModelGenerator>
- <!-- 生成映射文件的包名和位置-->
- <sqlMapGenerator targetPackage="test.mapping" targetProject="src">
- <property name="enableSubPackages" value="true"/>
- </sqlMapGenerator>
- <!-- 生成DAO的包名和位置-->
- <javaClientGenerator type="XMLMAPPER" targetPackage="test.dao" targetProject="src">
- <property name="enableSubPackages" value="true"/>
- </javaClientGenerator>
- <!-- 要生成哪些表-->
- <table tableName="about" domainObjectName="AboutDto" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
- <table tableName="user" domainObjectName="UserDto" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
- <table tableName="syslogs" domainObjectName="SyslogsDto" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></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>
<!-- 数据库驱动-->
<classPathEntry location="mysql-connector-java-5.0.6-bin.jar"/>
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressDate" value="true"/>
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!--数据库链接URL,用户名、密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost/test" userId="test" password="test">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!-- 生成模型的包名和位置-->
<javaModelGenerator targetPackage="test.model" targetProject="src">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!-- 生成映射文件的包名和位置-->
<sqlMapGenerator targetPackage="test.mapping" targetProject="src">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!-- 生成DAO的包名和位置-->
<javaClientGenerator type="XMLMAPPER" targetPackage="test.dao" targetProject="src">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 要生成哪些表-->
<table tableName="about" domainObjectName="AboutDto" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="user" domainObjectName="UserDto" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="syslogs" domainObjectName="SyslogsDto" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
1、其中需要注意的有数据库驱动、数据库URL、用户名、密码、生成模型的包名和位置、生成映射文件的包名和位置、生成DAO的包名和位置以及最后需要生成的表名和对应的类名。
四、运行
需要通过CMD命令行方式来运行,首先可以先准备一个运行的脚本,这里使用的脚本是:Java -jar mybatis-generator-core-1.3.2.jar -configfile generatorConfig.xml -overwrite
需要注意的是:mybatis-generator-core-1.3.2.jar为下载的对应版本的jar,generatorConfig.xml 为配置文件名,如果不为这个可以在这里进行修改。
启动cmd进入到“F:\soft\mybatis-generator-core-1.3.2\lib”这个目录下,如图:
生成成功后进到src目录下,可以看到已经生成了对应的model、dao、mapping,如图:
下面可以看看生成后的UserMapper.xml
- <?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="test.dao.UserDtoMapper" >
- <resultMap id="BaseResultMap" type="test.model.UserDto" >
- <id column="id" property="id" jdbcType="VARCHAR" />
- <result column="username" property="username" jdbcType="VARCHAR" />
- <result column="password" property="password" jdbcType="VARCHAR" />
- <result column="email" property="email" jdbcType="VARCHAR" />
- <result column="name" property="name" jdbcType="VARCHAR" />
- <result column="sex" property="sex" jdbcType="VARCHAR" />
- <result column="birthday" property="birthday" jdbcType="VARCHAR" />
- <result column="address" property="address" jdbcType="VARCHAR" />
- <result column="tel" property="tel" jdbcType="VARCHAR" />
- <result column="qq" property="qq" jdbcType="VARCHAR" />
- <result column="image" property="image" jdbcType="VARCHAR" />
- <result column="sfjh" property="sfjh" jdbcType="VARCHAR" />
- <result column="sfzx" property="sfzx" jdbcType="VARCHAR" />
- <result column="sfhf" property="sfhf" jdbcType="VARCHAR" />
- <result column="sfpl" property="sfpl" jdbcType="VARCHAR" />
- <result column="sffx" property="sffx" jdbcType="VARCHAR" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, username, password, email, name, sex, birthday, address, tel, qq, image, sfjh,
- sfzx, sfhf, sfpl, sffx
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
- select
- <include refid="Base_Column_List" />
- from user
- where id = #{id,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
- delete from user
- where id = #{id,jdbcType=VARCHAR}
- </delete>
- <insert id="insert" parameterType="test.model.UserDto" >
- insert into user (id, username, password,
- email, name, sex, birthday,
- address, tel, qq, image,
- sfjh, sfzx, sfhf, sfpl,
- sffx)
- values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
- #{email,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{birthday,jdbcType=VARCHAR},
- #{address,jdbcType=VARCHAR}, #{tel,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR},
- #{sfjh,jdbcType=VARCHAR}, #{sfzx,jdbcType=VARCHAR}, #{sfhf,jdbcType=VARCHAR}, #{sfpl,jdbcType=VARCHAR},
- #{sffx,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="test.model.UserDto" >
- insert into user
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="username != null" >
- username,
- </if>
- <if test="password != null" >
- password,
- </if>
- <if test="email != null" >
- email,
- </if>
- <if test="name != null" >
- name,
- </if>
- <if test="sex != null" >
- sex,
- </if>
- <if test="birthday != null" >
- birthday,
- </if>
- <if test="address != null" >
- address,
- </if>
- <if test="tel != null" >
- tel,
- </if>
- <if test="qq != null" >
- qq,
- </if>
- <if test="image != null" >
- image,
- </if>
- <if test="sfjh != null" >
- sfjh,
- </if>
- <if test="sfzx != null" >
- sfzx,
- </if>
- <if test="sfhf != null" >
- sfhf,
- </if>
- <if test="sfpl != null" >
- sfpl,
- </if>
- <if test="sffx != null" >
- sffx,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=VARCHAR},
- </if>
- <if test="username != null" >
- #{username,jdbcType=VARCHAR},
- </if>
- <if test="password != null" >
- #{password,jdbcType=VARCHAR},
- </if>
- <if test="email != null" >
- #{email,jdbcType=VARCHAR},
- </if>
- <if test="name != null" >
- #{name,jdbcType=VARCHAR},
- </if>
- <if test="sex != null" >
- #{sex,jdbcType=VARCHAR},
- </if>
- <if test="birthday != null" >
- #{birthday,jdbcType=VARCHAR},
- </if>
- <if test="address != null" >
- #{address,jdbcType=VARCHAR},
- </if>
- <if test="tel != null" >
- #{tel,jdbcType=VARCHAR},
- </if>
- <if test="qq != null" >
- #{qq,jdbcType=VARCHAR},
- </if>
- <if test="image != null" >
- #{image,jdbcType=VARCHAR},
- </if>
- <if test="sfjh != null" >
- #{sfjh,jdbcType=VARCHAR},
- </if>
- <if test="sfzx != null" >
- #{sfzx,jdbcType=VARCHAR},
- </if>
- <if test="sfhf != null" >
- #{sfhf,jdbcType=VARCHAR},
- </if>
- <if test="sfpl != null" >
- #{sfpl,jdbcType=VARCHAR},
- </if>
- <if test="sffx != null" >
- #{sffx,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="test.model.UserDto" >
- update user
- <set >
- <if test="username != null" >
- username = #{username,jdbcType=VARCHAR},
- </if>
- <if test="password != null" >
- password = #{password,jdbcType=VARCHAR},
- </if>
- <if test="email != null" >
- email = #{email,jdbcType=VARCHAR},
- </if>
- <if test="name != null" >
- name = #{name,jdbcType=VARCHAR},
- </if>
- <if test="sex != null" >
- sex = #{sex,jdbcType=VARCHAR},
- </if>
- <if test="birthday != null" >
- birthday = #{birthday,jdbcType=VARCHAR},
- </if>
- <if test="address != null" >
- address = #{address,jdbcType=VARCHAR},
- </if>
- <if test="tel != null" >
- tel = #{tel,jdbcType=VARCHAR},
- </if>
- <if test="qq != null" >
- qq = #{qq,jdbcType=VARCHAR},
- </if>
- <if test="image != null" >
- image = #{image,jdbcType=VARCHAR},
- </if>
- <if test="sfjh != null" >
- sfjh = #{sfjh,jdbcType=VARCHAR},
- </if>
- <if test="sfzx != null" >
- sfzx = #{sfzx,jdbcType=VARCHAR},
- </if>
- <if test="sfhf != null" >
- sfhf = #{sfhf,jdbcType=VARCHAR},
- </if>
- <if test="sfpl != null" >
- sfpl = #{sfpl,jdbcType=VARCHAR},
- </if>
- <if test="sffx != null" >
- sffx = #{sffx,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKey" parameterType="test.model.UserDto" >
- update user
- set username = #{username,jdbcType=VARCHAR},
- password = #{password,jdbcType=VARCHAR},
- email = #{email,jdbcType=VARCHAR},
- name = #{name,jdbcType=VARCHAR},
- sex = #{sex,jdbcType=VARCHAR},
- birthday = #{birthday,jdbcType=VARCHAR},
- address = #{address,jdbcType=VARCHAR},
- tel = #{tel,jdbcType=VARCHAR},
- qq = #{qq,jdbcType=VARCHAR},
- image = #{image,jdbcType=VARCHAR},
- sfjh = #{sfjh,jdbcType=VARCHAR},
- sfzx = #{sfzx,jdbcType=VARCHAR},
- sfhf = #{sfhf,jdbcType=VARCHAR},
- sfpl = #{sfpl,jdbcType=VARCHAR},
- sffx = #{sffx,jdbcType=VARCHAR}
- where id = #{id,jdbcType=VARCHAR}
- </update>
- </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="test.dao.UserDtoMapper" >
<resultMap id="BaseResultMap" type="test.model.UserDto" >
<id column="id" property="id" jdbcType="VARCHAR" />
<result column="username" property="username" jdbcType="VARCHAR" />
<result column="password" property="password" jdbcType="VARCHAR" />
<result column="email" property="email" jdbcType="VARCHAR" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="sex" property="sex" jdbcType="VARCHAR" />
<result column="birthday" property="birthday" jdbcType="VARCHAR" />
<result column="address" property="address" jdbcType="VARCHAR" />
<result column="tel" property="tel" jdbcType="VARCHAR" />
<result column="qq" property="qq" jdbcType="VARCHAR" />
<result column="image" property="image" jdbcType="VARCHAR" />
<result column="sfjh" property="sfjh" jdbcType="VARCHAR" />
<result column="sfzx" property="sfzx" jdbcType="VARCHAR" />
<result column="sfhf" property="sfhf" jdbcType="VARCHAR" />
<result column="sfpl" property="sfpl" jdbcType="VARCHAR" />
<result column="sffx" property="sffx" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, username, password, email, name, sex, birthday, address, tel, qq, image, sfjh,
sfzx, sfhf, sfpl, sffx
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from user
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from user
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="test.model.UserDto" >
insert into user (id, username, password,
email, name, sex, birthday,
address, tel, qq, image,
sfjh, sfzx, sfhf, sfpl,
sffx)
values (#{id,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{birthday,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR}, #{tel,jdbcType=VARCHAR}, #{qq,jdbcType=VARCHAR}, #{image,jdbcType=VARCHAR},
#{sfjh,jdbcType=VARCHAR}, #{sfzx,jdbcType=VARCHAR}, #{sfhf,jdbcType=VARCHAR}, #{sfpl,jdbcType=VARCHAR},
#{sffx,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="test.model.UserDto" >
insert into user
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="username != null" >
username,
</if>
<if test="password != null" >
password,
</if>
<if test="email != null" >
email,
</if>
<if test="name != null" >
name,
</if>
<if test="sex != null" >
sex,
</if>
<if test="birthday != null" >
birthday,
</if>
<if test="address != null" >
address,
</if>
<if test="tel != null" >
tel,
</if>
<if test="qq != null" >
qq,
</if>
<if test="image != null" >
image,
</if>
<if test="sfjh != null" >
sfjh,
</if>
<if test="sfzx != null" >
sfzx,
</if>
<if test="sfhf != null" >
sfhf,
</if>
<if test="sfpl != null" >
sfpl,
</if>
<if test="sffx != null" >
sffx,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=VARCHAR},
</if>
<if test="username != null" >
#{username,jdbcType=VARCHAR},
</if>
<if test="password != null" >
#{password,jdbcType=VARCHAR},
</if>
<if test="email != null" >
#{email,jdbcType=VARCHAR},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="sex != null" >
#{sex,jdbcType=VARCHAR},
</if>
<if test="birthday != null" >
#{birthday,jdbcType=VARCHAR},
</if>
<if test="address != null" >
#{address,jdbcType=VARCHAR},
</if>
<if test="tel != null" >
#{tel,jdbcType=VARCHAR},
</if>
<if test="qq != null" >
#{qq,jdbcType=VARCHAR},
</if>
<if test="image != null" >
#{image,jdbcType=VARCHAR},
</if>
<if test="sfjh != null" >
#{sfjh,jdbcType=VARCHAR},
</if>
<if test="sfzx != null" >
#{sfzx,jdbcType=VARCHAR},
</if>
<if test="sfhf != null" >
#{sfhf,jdbcType=VARCHAR},
</if>
<if test="sfpl != null" >
#{sfpl,jdbcType=VARCHAR},
</if>
<if test="sffx != null" >
#{sffx,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="test.model.UserDto" >
update user
<set >
<if test="username != null" >
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password != null" >
password = #{password,jdbcType=VARCHAR},
</if>
<if test="email != null" >
email = #{email,jdbcType=VARCHAR},
</if>
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="sex != null" >
sex = #{sex,jdbcType=VARCHAR},
</if>
<if test="birthday != null" >
birthday = #{birthday,jdbcType=VARCHAR},
</if>
<if test="address != null" >
address = #{address,jdbcType=VARCHAR},
</if>
<if test="tel != null" >
tel = #{tel,jdbcType=VARCHAR},
</if>
<if test="qq != null" >
qq = #{qq,jdbcType=VARCHAR},
</if>
<if test="image != null" >
image = #{image,jdbcType=VARCHAR},
</if>
<if test="sfjh != null" >
sfjh = #{sfjh,jdbcType=VARCHAR},
</if>
<if test="sfzx != null" >
sfzx = #{sfzx,jdbcType=VARCHAR},
</if>
<if test="sfhf != null" >
sfhf = #{sfhf,jdbcType=VARCHAR},
</if>
<if test="sfpl != null" >
sfpl = #{sfpl,jdbcType=VARCHAR},
</if>
<if test="sffx != null" >
sffx = #{sffx,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="test.model.UserDto" >
update user
set username = #{username,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
email = #{email,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
birthday = #{birthday,jdbcType=VARCHAR},
address = #{address,jdbcType=VARCHAR},
tel = #{tel,jdbcType=VARCHAR},
qq = #{qq,jdbcType=VARCHAR},
image = #{image,jdbcType=VARCHAR},
sfjh = #{sfjh,jdbcType=VARCHAR},
sfzx = #{sfzx,jdbcType=VARCHAR},
sfhf = #{sfhf,jdbcType=VARCHAR},
sfpl = #{sfpl,jdbcType=VARCHAR},
sffx = #{sffx,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
接下来就可以将这三个目录拷贝到对应项目的目录中,如果需要新增自己的方法可以修改dao类。
更多文章见:http://www.16boke.com/article/detail/108
-
顶
- 14
-
踩
- 1
- 上一篇Spring MVC学习一
- 下一篇使用注解来定义联合主键
我的同类文章
- •SpringMVC 无法使用aop拦截的解决方案2014-09-01
- •Spring使用JdbcTemplate实现对数据库操作2014-07-14
- •Hibernate的工具类HibernateUtils2013-06-05
- •Spring MVC学习一2013-06-03
- •Struts2源码分析一2013-05-19
- •Spring+Servlet整合(如何向Servlet注入属性)2014-09-01
- •Spring MVC学习二2013-06-18
- •使用注解来定义联合主键2013-06-05
- •Struts2源码分析二2013-05-19
- •JMS简介以及WebLogic配置JMS例子2013-05-08
19楼 yqme 2016-11-27 14:22发表 [回复] [引用] [举报]-
-
我下载下载的咋和你这不一样了
18楼 老哥__稳 2016-11-23 12:00发表 [回复] [引用] [举报]-
-
可以,get了
17楼 roy2011a 2016-07-15 17:56发表 [回复] [引用] [举报]-
-
16楼不厚道啊,分明是类砸场子的,jfx。。。
16楼 欧文不哭 2016-06-21 23:01发表 [回复] [引用] [举报]-
-
本人使用JavaFX写了一个mybatis generator带界面的工具,非常方便使用,github网址是:https://github.com/astarring/mybatis-generator-gui 欢迎大家下载试用试用,有什么问题可以在github中提issue交流。
15楼 刘天 2016-05-16 17:12发表 [回复] [引用] [举报]-
-
数据库不要端口吗?
Re: 一路博客博主 2016-05-20 09:51发表 [回复] [引用] [举报]-
-
回复u011105859:欢迎关注一路博客,http://www.16boke.com,或者本站的新浪微博,http://weibo.com/putiman,会不定时的发布工作中遇到的问题,以及学习总结。
Re: 一路博客博主 2016-05-20 09:41发表 [回复] [引用] [举报]-
-
回复u011105859:mysql默认3306端口,可以不用写
14楼 Run丶Boy 2016-05-13 10:17发表 [回复] [引用] [举报]-
-
好东西!!
13楼 水田如雅 2016-04-09 16:45发表 [回复] [引用] [举报]-
-
get
12楼 guile 2015-12-25 15:21发表 [回复] [引用] [举报]-
-
有 mybatis generator 的 eclipse 插架,很好使。
11楼 小有秋声 2015-12-10 23:01发表 [回复] [引用] [举报]-
-
比如我建了一个叫org_user的表,结果生成的时候会把数据库自带的同名表的字段也生成,查过资料说在tableName里面的表名前加用户名,可是我加了之后貌似像找不到表一样不生成任何东西,不知道楼主是否有运见过同样的问题?如有怎么解决的?
10楼 ly001002 2015-11-24 18:11发表 [回复] [引用] [举报]-
-
[html]
view plain
copy
print
?
- <a href='https://www.baidu.com'>百度一下你就知道</a>
有eclipse插件的
Re: pl在之心 2015-12-22 21:40发表 [回复] [引用] [举报]-
-
回复lblily:多谢提醒
9楼 qq_32954033 2015-11-19 23:52发表 [回复] [引用] [举报]-
-
您好,我想链接sql server数据库,请问如果操作?QQ:373978475,提前谢谢
8楼 小城风带香 2015-10-10 19:22发表 [回复] [引用] [举报]-
-
很好哦
7楼 亮叔不会飞 2015-10-09 15:43发表 [回复] [引用] [举报]-
-
不错,感谢。
6楼 西域榴莲 2015-08-21 13:45发表 [回复] [引用] [举报]-
-
你好,我运行之后报错
cannot resolve classpath entry:mysql-connector-java-5.1.5-bin.jar
然后配置了classpath没有用
5楼 紫月er 2015-08-12 11:29发表 [回复] [引用] [举报]-
-
很好,谢谢喽
4楼 darren中 2014-09-14 11:47发表 [回复] [引用] [举报]-
-
http://darrenzhong.com/?p=84 这里有插件的详细使用和安装教程
3楼 tianhuan820 2014-08-11 11:45发表 [回复] [引用] [举报]-
-
这个东西eclipse没有对应插件么
2楼 JimmyLincole 2014-07-17 11:40发表 [回复] [引用] [举报]-
-
在itellij idea如何使用mybatis-generator工具呀?谢谢
1楼 blueman2012 2014-06-08 14:44发表 [回复] [引用] [举报]-
-
你好,可以把你生成的工具压缩发给我吗?因为现在mybatis-generatore是用maven构建了,我没有maven的环境,弄起来比较麻烦。我的邮箱地址:qiujianf@163.com