Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mybatis-generator-plugin
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mybatis-generator-plugin
Commits
6246cc63
Commit
6246cc63
authored
Jul 07, 2017
by
hewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TableRenamePlugin测试用例
parent
b12bf6f0
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
279 additions
and
13 deletions
+279
-13
src/test/java/com/itfsw/mybatis/generator/plugins/ExampleTargetPluginTest.java
...sw/mybatis/generator/plugins/ExampleTargetPluginTest.java
+12
-0
src/test/java/com/itfsw/mybatis/generator/plugins/TableRenamePluginTest.java
...tfsw/mybatis/generator/plugins/TableRenamePluginTest.java
+63
-0
src/test/java/com/itfsw/mybatis/generator/plugins/tools/DBHelper.java
...a/com/itfsw/mybatis/generator/plugins/tools/DBHelper.java
+5
-3
src/test/java/com/itfsw/mybatis/generator/plugins/tools/MyBatisGeneratorTool.java
...mybatis/generator/plugins/tools/MyBatisGeneratorTool.java
+7
-10
src/test/resources/scripts/ExampleTargetPlugin/mybatis-generator-without-target.xml
.../ExampleTargetPlugin/mybatis-generator-without-target.xml
+54
-0
src/test/resources/scripts/TableRenamePlugin/init.sql
src/test/resources/scripts/TableRenamePlugin/init.sql
+30
-0
src/test/resources/scripts/TableRenamePlugin/mybatis-generator-with-domainObject.xml
...TableRenamePlugin/mybatis-generator-with-domainObject.xml
+53
-0
src/test/resources/scripts/TableRenamePlugin/mybatis-generator-with-wrong-properties.xml
...eRenamePlugin/mybatis-generator-with-wrong-properties.xml
+55
-0
No files found.
src/test/java/com/itfsw/mybatis/generator/plugins/ExampleTargetPluginTest.java
View file @
6246cc63
...
@@ -23,6 +23,8 @@ import org.junit.BeforeClass;
...
@@ -23,6 +23,8 @@ import org.junit.BeforeClass;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.mybatis.generator.api.GeneratedJavaFile
;
import
org.mybatis.generator.api.GeneratedJavaFile
;
import
org.mybatis.generator.api.MyBatisGenerator
;
import
org.mybatis.generator.api.MyBatisGenerator
;
import
org.mybatis.generator.exception.InvalidConfigurationException
;
import
org.mybatis.generator.exception.XMLParserException
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
...
@@ -48,6 +50,16 @@ public class ExampleTargetPluginTest {
...
@@ -48,6 +50,16 @@ public class ExampleTargetPluginTest {
DBHelper
.
createDB
(
"scripts/ExampleTargetPlugin/init.sql"
);
DBHelper
.
createDB
(
"scripts/ExampleTargetPlugin/init.sql"
);
}
}
/**
* 测试异常配置
*/
@Test
public
void
testWarnings
()
throws
IOException
,
XMLParserException
,
InvalidConfigurationException
,
InterruptedException
,
SQLException
{
MyBatisGeneratorTool
tool
=
MyBatisGeneratorTool
.
create
(
"scripts/ExampleTargetPlugin/mybatis-generator-without-target.xml"
);
tool
.
generate
();
Assert
.
assertEquals
(
tool
.
getWarnings
().
get
(
0
),
"请配置com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin插件的目标包名(targetPackage)!"
);
}
@Test
@Test
public
void
testNormalPath
()
throws
Exception
{
public
void
testNormalPath
()
throws
Exception
{
MyBatisGeneratorTool
tool
=
MyBatisGeneratorTool
.
create
(
"scripts/ExampleTargetPlugin/mybatis-generator-without-plugin.xml"
);
MyBatisGeneratorTool
tool
=
MyBatisGeneratorTool
.
create
(
"scripts/ExampleTargetPlugin/mybatis-generator-without-plugin.xml"
);
...
...
src/test/java/com/itfsw/mybatis/generator/plugins/TableRenamePluginTest.java
0 → 100644
View file @
6246cc63
/*
* Copyright (c) 2017.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
itfsw
.
mybatis
.
generator
.
plugins
;
import
com.itfsw.mybatis.generator.plugins.tools.DBHelper
;
import
com.itfsw.mybatis.generator.plugins.tools.MyBatisGeneratorTool
;
import
org.junit.Assert
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
org.mybatis.generator.exception.InvalidConfigurationException
;
import
org.mybatis.generator.exception.XMLParserException
;
import
java.io.IOException
;
import
java.sql.SQLException
;
/**
* ---------------------------------------------------------------------------
*
* ---------------------------------------------------------------------------
* @author: hewei
* @time:2017/7/7 9:36
* ---------------------------------------------------------------------------
*/
public
class
TableRenamePluginTest
{
/**
* 初始化
*/
@BeforeClass
public
static
void
init
()
throws
Exception
{
DBHelper
.
createDB
(
"scripts/TableRenamePlugin/init.sql"
);
}
/**
* 测试提示信息
*/
@Test
public
void
testWarnings
()
throws
IOException
,
XMLParserException
,
InvalidConfigurationException
,
InterruptedException
,
SQLException
{
// searchString、replaceString 单独配置
MyBatisGeneratorTool
tool
=
MyBatisGeneratorTool
.
create
(
"scripts/TableRenamePlugin/mybatis-generator-with-wrong-properties.xml"
);
tool
.
generate
();
Assert
.
assertEquals
(
tool
.
getWarnings
().
get
(
0
),
"itfsw:插件com.itfsw.mybatis.generator.plugins.TableRenamePlugin插件的searchString、replaceString属性需配合使用,不能单独存在!"
);
// 和官方domainObjectName或者mapperName一起配置
tool
=
MyBatisGeneratorTool
.
create
(
"scripts/TableRenamePlugin/mybatis-generator-with-domainObject.xml"
);
tool
.
generate
();
Assert
.
assertEquals
(
tool
.
getWarnings
().
get
(
0
),
"itfsw:插件com.itfsw.mybatis.generator.plugins.TableRenamePlugin插件请不要配合table的domainObjectName或者mapperName一起使用!"
);
}
}
src/test/java/com/itfsw/mybatis/generator/plugins/tools/DBHelper.java
View file @
6246cc63
...
@@ -24,6 +24,7 @@ import java.io.InputStream;
...
@@ -24,6 +24,7 @@ import java.io.InputStream;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.DriverManager
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
java.util.Properties
;
import
java.util.Properties
;
...
@@ -53,11 +54,12 @@ public class DBHelper {
...
@@ -53,11 +54,12 @@ public class DBHelper {
/**
/**
* 创建数据库
* 创建数据库
*
* @param resource
* @param resource
* @throws Exception
* @throws ClassNotFoundException
* @throws SQLException
* @throws IOException
*/
*/
public
static
void
createDB
(
String
resource
)
throws
Exception
{
public
static
void
createDB
(
String
resource
)
throws
ClassNotFoundException
,
SQLException
,
IO
Exception
{
String
driver
=
properties
.
getProperty
(
"driver"
);
String
driver
=
properties
.
getProperty
(
"driver"
);
String
url
=
properties
.
getProperty
(
"url"
);
String
url
=
properties
.
getProperty
(
"url"
);
String
username
=
properties
.
getProperty
(
"username"
);
String
username
=
properties
.
getProperty
(
"username"
);
...
...
src/test/java/com/itfsw/mybatis/generator/plugins/tools/MyBatisGeneratorTool.java
View file @
6246cc63
...
@@ -27,6 +27,8 @@ import org.mybatis.generator.api.MyBatisGenerator;
...
@@ -27,6 +27,8 @@ import org.mybatis.generator.api.MyBatisGenerator;
import
org.mybatis.generator.config.Configuration
;
import
org.mybatis.generator.config.Configuration
;
import
org.mybatis.generator.config.Context
;
import
org.mybatis.generator.config.Context
;
import
org.mybatis.generator.config.xml.ConfigurationParser
;
import
org.mybatis.generator.config.xml.ConfigurationParser
;
import
org.mybatis.generator.exception.InvalidConfigurationException
;
import
org.mybatis.generator.exception.XMLParserException
;
import
org.mybatis.generator.internal.DefaultShellCallback
;
import
org.mybatis.generator.internal.DefaultShellCallback
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
...
@@ -62,11 +64,10 @@ public class MyBatisGeneratorTool {
...
@@ -62,11 +64,10 @@ public class MyBatisGeneratorTool {
/**
/**
* 创建
* 创建
*
* @param resource
* @param resource
* @return
* @return
*/
*/
public
static
MyBatisGeneratorTool
create
(
String
resource
)
throws
Exception
{
public
static
MyBatisGeneratorTool
create
(
String
resource
)
throws
IOException
,
XMLParser
Exception
{
MyBatisGeneratorTool
tool
=
new
MyBatisGeneratorTool
();
MyBatisGeneratorTool
tool
=
new
MyBatisGeneratorTool
();
tool
.
warnings
=
new
ArrayList
<>();
tool
.
warnings
=
new
ArrayList
<>();
...
@@ -80,14 +81,13 @@ public class MyBatisGeneratorTool {
...
@@ -80,14 +81,13 @@ public class MyBatisGeneratorTool {
/**
/**
* 执行MyBatisGenerator
* 执行MyBatisGenerator
*
* @param callback
* @param callback
* @return
* @return
* @throws SQLException
* @throws SQLException
* @throws IOException
* @throws IOException
* @throws InterruptedException
* @throws InterruptedException
*/
*/
public
MyBatisGenerator
generate
(
AbstractShellCallback
callback
)
throws
Exception
{
public
MyBatisGenerator
generate
(
AbstractShellCallback
callback
)
throws
InvalidConfigurationException
,
InterruptedException
,
SQLException
,
IO
Exception
{
callback
.
setTool
(
this
);
callback
.
setTool
(
this
);
MyBatisGenerator
myBatisGenerator
=
new
MyBatisGenerator
(
config
,
callback
,
warnings
);
MyBatisGenerator
myBatisGenerator
=
new
MyBatisGenerator
(
config
,
callback
,
warnings
);
myBatisGenerator
.
generate
(
null
,
null
,
null
,
true
);
myBatisGenerator
.
generate
(
null
,
null
,
null
,
true
);
...
@@ -96,13 +96,12 @@ public class MyBatisGeneratorTool {
...
@@ -96,13 +96,12 @@ public class MyBatisGeneratorTool {
/**
/**
* 执行MyBatisGenerator(不生成文件)
* 执行MyBatisGenerator(不生成文件)
*
* @return
* @return
* @throws SQLException
* @throws SQLException
* @throws IOException
* @throws IOException
* @throws InterruptedException
* @throws InterruptedException
*/
*/
public
MyBatisGenerator
generate
()
throws
Exception
{
public
MyBatisGenerator
generate
()
throws
InvalidConfigurationException
,
InterruptedException
,
SQLException
,
IO
Exception
{
MyBatisGenerator
myBatisGenerator
=
new
MyBatisGenerator
(
config
,
new
DefaultShellCallback
(
true
),
warnings
);
MyBatisGenerator
myBatisGenerator
=
new
MyBatisGenerator
(
config
,
new
DefaultShellCallback
(
true
),
warnings
);
myBatisGenerator
.
generate
(
null
,
null
,
null
,
false
);
myBatisGenerator
.
generate
(
null
,
null
,
null
,
false
);
return
myBatisGenerator
;
return
myBatisGenerator
;
...
@@ -110,7 +109,6 @@ public class MyBatisGeneratorTool {
...
@@ -110,7 +109,6 @@ public class MyBatisGeneratorTool {
/**
/**
* 编译项目并返回 SqlSession
* 编译项目并返回 SqlSession
*
* @return
* @return
*/
*/
public
SqlSession
compile
()
throws
IOException
,
ClassNotFoundException
{
public
SqlSession
compile
()
throws
IOException
,
ClassNotFoundException
{
...
@@ -176,7 +174,6 @@ public class MyBatisGeneratorTool {
...
@@ -176,7 +174,6 @@ public class MyBatisGeneratorTool {
/**
/**
* 获取指定后缀的文件
* 获取指定后缀的文件
*
* @param file
* @param file
* @return
* @return
*/
*/
...
@@ -198,10 +195,10 @@ public class MyBatisGeneratorTool {
...
@@ -198,10 +195,10 @@ public class MyBatisGeneratorTool {
/**
/**
* 修正配置到指定target
* 修正配置到指定target
*/
*/
private
void
fixConfigToTarget
(){
private
void
fixConfigToTarget
()
{
this
.
targetProject
=
this
.
getClass
().
getClassLoader
().
getResource
(
""
).
getPath
();
this
.
targetProject
=
this
.
getClass
().
getClassLoader
().
getResource
(
""
).
getPath
();
this
.
targetPackage
=
DAO_PACKAGE
+
".s"
+
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
).
format
(
new
Date
());
this
.
targetPackage
=
DAO_PACKAGE
+
".s"
+
new
SimpleDateFormat
(
"yyyyMMddHHmmssSSS"
).
format
(
new
Date
());
for
(
Context
context
:
config
.
getContexts
()){
for
(
Context
context
:
config
.
getContexts
())
{
context
.
getJavaModelGeneratorConfiguration
().
setTargetProject
(
targetProject
);
context
.
getJavaModelGeneratorConfiguration
().
setTargetProject
(
targetProject
);
context
.
getJavaModelGeneratorConfiguration
().
setTargetPackage
(
targetPackage
);
context
.
getJavaModelGeneratorConfiguration
().
setTargetPackage
(
targetPackage
);
context
.
getSqlMapGeneratorConfiguration
().
setTargetProject
(
targetProject
);
context
.
getSqlMapGeneratorConfiguration
().
setTargetProject
(
targetProject
);
...
...
src/test/resources/scripts/ExampleTargetPlugin/mybatis-generator-without-target.xml
0 → 100644
View file @
6246cc63
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2017.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<properties
resource=
"db.properties"
/>
<!--导入属性配置 -->
<context
id=
"default"
targetRuntime=
"MyBatis3"
>
<!-- 插件 -->
<!-- Example 目标包修改插件 -->
<plugin
type=
"com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin"
/>
<!--jdbc的数据库连接 -->
<jdbcConnection
driverClass=
"${driver}"
connectionURL=
"${url}"
userId=
"${username}"
password=
"${password}"
/>
<!-- Model模型生成器,用来生成含有主键key的类,记录类 以及查询Example类
targetPackage 指定生成的model生成所在的包名
targetProject 指定在该项目下所在的路径 -->
<javaModelGenerator
targetPackage=
""
targetProject=
""
>
<!-- 是否对model添加 构造函数 -->
<property
name=
"constructorBased"
value=
"true"
/>
<!-- 给Model添加一个父类 -->
<!--<property name="rootClass" value="com.itfsw.base"/>-->
</javaModelGenerator>
<!--Mapper映射文件生成所在的目录 为每一个数据库的表生成对应的SqlMap文件 -->
<sqlMapGenerator
targetPackage=
""
targetProject=
""
/>
<!-- 客户端代码,生成易于使用的针对Model对象和XML配置文件 的代码
type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper对象
type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象
type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口 -->
<javaClientGenerator
targetPackage=
""
targetProject=
""
type=
"XMLMAPPER"
/>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 要自动生成的表 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<table
tableName=
"tb"
>
<generatedKey
column=
"id"
sqlStatement=
"MySql"
identity=
"true"
/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
src/test/resources/scripts/TableRenamePlugin/init.sql
0 → 100644
View file @
6246cc63
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50617
Source Host : localhost:3306
Source Database : mybatis-generator-plugin
Target Server Type : MYSQL
Target Server Version : 50617
File Encoding : 65001
Date: 2017-06-26 17:30:13
*/
SET
FOREIGN_KEY_CHECKS
=
0
;
-- ----------------------------
-- Table structure for tb
-- ----------------------------
DROP
TABLE
IF
EXISTS
`tb`
;
CREATE
TABLE
`tb`
(
`id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'注释1'
,
`field1`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'注释2'
,
PRIMARY
KEY
(
`id`
)
);
-- ----------------------------
-- Records of tb
-- ----------------------------
\ No newline at end of file
src/test/resources/scripts/TableRenamePlugin/mybatis-generator-with-domainObject.xml
0 → 100644
View file @
6246cc63
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2017.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<properties
resource=
"db.properties"
/>
<!--导入属性配置 -->
<context
id=
"default"
targetRuntime=
"MyBatis3"
>
<!-- 插件 -->
<plugin
type=
"com.itfsw.mybatis.generator.plugins.TableRenamePlugin"
/>
<!--jdbc的数据库连接 -->
<jdbcConnection
driverClass=
"${driver}"
connectionURL=
"${url}"
userId=
"${username}"
password=
"${password}"
/>
<!-- Model模型生成器,用来生成含有主键key的类,记录类 以及查询Example类
targetPackage 指定生成的model生成所在的包名
targetProject 指定在该项目下所在的路径 -->
<javaModelGenerator
targetPackage=
""
targetProject=
""
>
<!-- 是否对model添加 构造函数 -->
<property
name=
"constructorBased"
value=
"true"
/>
<!-- 给Model添加一个父类 -->
<!--<property name="rootClass" value="com.itfsw.base"/>-->
</javaModelGenerator>
<!--Mapper映射文件生成所在的目录 为每一个数据库的表生成对应的SqlMap文件 -->
<sqlMapGenerator
targetPackage=
""
targetProject=
""
/>
<!-- 客户端代码,生成易于使用的针对Model对象和XML配置文件 的代码
type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper对象
type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象
type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口 -->
<javaClientGenerator
targetPackage=
""
targetProject=
""
type=
"XMLMAPPER"
/>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 要自动生成的表 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<table
tableName=
"tb"
domainObjectName=
"Test"
>
<generatedKey
column=
"id"
sqlStatement=
"MySql"
identity=
"true"
/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
src/test/resources/scripts/TableRenamePlugin/mybatis-generator-with-wrong-properties.xml
0 → 100644
View file @
6246cc63
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2017.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<properties
resource=
"db.properties"
/>
<!--导入属性配置 -->
<context
id=
"default"
targetRuntime=
"MyBatis3"
>
<!-- 插件 -->
<plugin
type=
"com.itfsw.mybatis.generator.plugins.TableRenamePlugin"
>
<property
name=
"searchString"
value=
"^T"
/>
</plugin>
<!--jdbc的数据库连接 -->
<jdbcConnection
driverClass=
"${driver}"
connectionURL=
"${url}"
userId=
"${username}"
password=
"${password}"
/>
<!-- Model模型生成器,用来生成含有主键key的类,记录类 以及查询Example类
targetPackage 指定生成的model生成所在的包名
targetProject 指定在该项目下所在的路径 -->
<javaModelGenerator
targetPackage=
""
targetProject=
""
>
<!-- 是否对model添加 构造函数 -->
<property
name=
"constructorBased"
value=
"true"
/>
<!-- 给Model添加一个父类 -->
<!--<property name="rootClass" value="com.itfsw.base"/>-->
</javaModelGenerator>
<!--Mapper映射文件生成所在的目录 为每一个数据库的表生成对应的SqlMap文件 -->
<sqlMapGenerator
targetPackage=
""
targetProject=
""
/>
<!-- 客户端代码,生成易于使用的针对Model对象和XML配置文件 的代码
type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper对象
type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象
type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口 -->
<javaClientGenerator
targetPackage=
""
targetProject=
""
type=
"XMLMAPPER"
/>
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 要自动生成的表 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
<table
tableName=
"tb"
>
<generatedKey
column=
"id"
sqlStatement=
"MySql"
identity=
"true"
/>
</table>
</context>
</generatorConfiguration>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment