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
666e319c
Commit
666e319c
authored
Oct 18, 2019
by
独孤求胜
Committed by
Gitee
Oct 18, 2019
Browse files
Options
Browse Files
Download
Plain Diff
!2 支持多个tablePrefix,以逗号隔开
Merge pull request !2 from minbyte/master
parents
4a9e0530
3201600b
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 @
666e319c
...
...
@@ -57,7 +57,7 @@ public class GenUtils {
tableEntity
.
setTableName
(
table
.
get
(
"tableName"
));
tableEntity
.
setComments
(
table
.
get
(
"tableComment"
));
//表名转换成Java类名
String
className
=
tableToJava
(
tableEntity
.
getTableName
(),
config
.
getString
(
"tablePrefix"
));
String
className
=
tableToJava
(
tableEntity
.
getTableName
(),
config
.
getString
Array
(
"tablePrefix"
));
tableEntity
.
setClassName
(
className
);
tableEntity
.
setClassname
(
StringUtils
.
uncapitalize
(
className
));
...
...
@@ -150,9 +150,11 @@ public class GenUtils {
/**
* 表名转换成Java类名
*/
public
static
String
tableToJava
(
String
tableName
,
String
tablePrefix
)
{
if
(
StringUtils
.
isNotBlank
(
tablePrefix
))
{
tableName
=
tableName
.
replaceFirst
(
tablePrefix
,
""
);
public
static
String
tableToJava
(
String
tableName
,
String
[]
tablePrefixArray
)
{
if
(
null
!=
tablePrefixArray
&&
tablePrefixArray
.
length
>
0
){
for
(
String
tablePrefix
:
tablePrefixArray
){
tableName
=
tableName
.
replace
(
tablePrefix
,
""
);
}
}
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