Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
renren-generator
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
吴迪
renren-generator
Commits
3201600b
Commit
3201600b
authored
Oct 18, 2019
by
huangmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持多个tablePrefix,以逗号隔开
parent
4a9e0530
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
GenUtils.java
src/main/java/io/renren/utils/GenUtils.java
+6
-4
No files found.
src/main/java/io/renren/utils/GenUtils.java
View file @
3201600b
...
@@ -57,7 +57,7 @@ public class GenUtils {
...
@@ -57,7 +57,7 @@ public class GenUtils {
tableEntity
.
setTableName
(
table
.
get
(
"tableName"
));
tableEntity
.
setTableName
(
table
.
get
(
"tableName"
));
tableEntity
.
setComments
(
table
.
get
(
"tableComment"
));
tableEntity
.
setComments
(
table
.
get
(
"tableComment"
));
//表名转换成Java类名
//表名转换成Java类名
String
className
=
tableToJava
(
tableEntity
.
getTableName
(),
config
.
getString
(
"tablePrefix"
));
String
className
=
tableToJava
(
tableEntity
.
getTableName
(),
config
.
getString
Array
(
"tablePrefix"
));
tableEntity
.
setClassName
(
className
);
tableEntity
.
setClassName
(
className
);
tableEntity
.
setClassname
(
StringUtils
.
uncapitalize
(
className
));
tableEntity
.
setClassname
(
StringUtils
.
uncapitalize
(
className
));
...
@@ -150,9 +150,11 @@ public class GenUtils {
...
@@ -150,9 +150,11 @@ public class GenUtils {
/**
/**
* 表名转换成Java类名
* 表名转换成Java类名
*/
*/
public
static
String
tableToJava
(
String
tableName
,
String
tablePrefix
)
{
public
static
String
tableToJava
(
String
tableName
,
String
[]
tablePrefixArray
)
{
if
(
StringUtils
.
isNotBlank
(
tablePrefix
))
{
if
(
null
!=
tablePrefixArray
&&
tablePrefixArray
.
length
>
0
){
tableName
=
tableName
.
replaceFirst
(
tablePrefix
,
""
);
for
(
String
tablePrefix
:
tablePrefixArray
){
tableName
=
tableName
.
replace
(
tablePrefix
,
""
);
}
}
}
return
columnToJava
(
tableName
);
return
columnToJava
(
tableName
);
}
}
...
...
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