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
30a3539f
Commit
30a3539f
authored
May 17, 2017
by
hewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对于Model生成WithBLOBs类时,SelectOneByExample插件实现行为和官方插件保持一致
parent
1f5e57dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
src/main/java/com/itfsw/mybatis/generator/plugins/utils/JavaElementGeneratorTools.java
...is/generator/plugins/utils/JavaElementGeneratorTools.java
+38
-0
No files found.
src/main/java/com/itfsw/mybatis/generator/plugins/utils/JavaElementGeneratorTools.java
View file @
30a3539f
...
@@ -16,8 +16,11 @@
...
@@ -16,8 +16,11 @@
package
com
.
itfsw
.
mybatis
.
generator
.
plugins
.
utils
;
package
com
.
itfsw
.
mybatis
.
generator
.
plugins
.
utils
;
import
org.mybatis.generator.api.IntrospectedTable
;
import
org.mybatis.generator.api.dom.java.*
;
import
org.mybatis.generator.api.dom.java.*
;
import
static
org
.
mybatis
.
generator
.
internal
.
util
.
messages
.
Messages
.
getString
;
/**
/**
* ---------------------------------------------------------------------------
* ---------------------------------------------------------------------------
* Java ele 生成工具
* Java ele 生成工具
...
@@ -133,4 +136,39 @@ public class JavaElementGeneratorTools {
...
@@ -133,4 +136,39 @@ public class JavaElementGeneratorTools {
);
);
return
generateMethodBody
(
method
,
"return this."
+
field
.
getName
()
+
";"
);
return
generateMethodBody
(
method
,
"return this."
+
field
.
getName
()
+
";"
);
}
}
/**
* 获取Model没有BLOBs类时的类型
*
* @param introspectedTable
* @return
*/
public
static
FullyQualifiedJavaType
getModelTypeWithoutBLOBs
(
IntrospectedTable
introspectedTable
){
FullyQualifiedJavaType
type
;
if
(
introspectedTable
.
getRules
().
generateBaseRecordClass
())
{
type
=
new
FullyQualifiedJavaType
(
introspectedTable
.
getBaseRecordType
());
}
else
if
(
introspectedTable
.
getRules
().
generatePrimaryKeyClass
())
{
type
=
new
FullyQualifiedJavaType
(
introspectedTable
.
getPrimaryKeyType
());
}
else
{
throw
new
RuntimeException
(
getString
(
"RuntimeError.12"
));
}
return
type
;
}
/**
* 获取Model有BLOBs类时的类型
*
* @param introspectedTable
* @return
*/
public
static
FullyQualifiedJavaType
getModelTypeWithBLOBs
(
IntrospectedTable
introspectedTable
){
FullyQualifiedJavaType
type
;
if
(
introspectedTable
.
getRules
().
generateRecordWithBLOBsClass
())
{
type
=
new
FullyQualifiedJavaType
(
introspectedTable
.
getRecordWithBLOBsType
());
}
else
{
// the blob fields must be rolled up into the base class
type
=
new
FullyQualifiedJavaType
(
introspectedTable
.
getBaseRecordType
());
}
return
type
;
}
}
}
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