Myeclipse添加mybatis generator插件
Myeclipse添加mybatis generator插件
地址:http://mybatis.googlecode.com/svn/sub-projects/generator/trunk/eclipse/UpdateSite/
Myeclipse-help-Myeclipse ConfigurationCenter
在mybatis下右击:Add to profile — pending Changes
MyBatis Generator Generated Java ClientObjects官网:
http://mybatis.org/generator/generatedobjects/javaclient.html
1、 数据库表:
CREATE TABLE IT_USER
(ROW_ID VARCHAR2(15) NOT NULL,
USERNAME VARCHAR2(16),
PWD VARCHAR2(32),
TELEPHONE VARCHAR2(30),
constraint PK_T_SCORE primarykey(ROW_ID)
);
createsequence a_seq --创建序列名字为 a_seq
minvalue1 -- 最小值为 1
maxvalue99999 --- 最大值为 99999
startwith1 --- 开始值 1
incrementby1 ---每次增长值 1
cache100;
INSERTINTOIT_USER(ROW_ID,USERNAME,PWD,TELEPHONE)
VALUES(a_seq.NEXTVAL,'王五','123456','123456789');
select *from IT_USER;
添加generatorConfig.xml,文件内容: