Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
4a9abfa4
Commit
4a9abfa4
authored
Sep 14, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[dev] used schema on table gen entity
parent
449aefa6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
3 deletions
+9
-3
generatorConfig.xml
atms-dao/etc/generator-oracle/generatorConfig.xml
+0
-0
vatGeneratorConfig.xml
atms-dao/etc/generator-oracle/vatGeneratorConfig.xml
+0
-0
ExtractCommitFromDiff.java
atms-gen/src/test/java/com/neo/ExtractCommitFromDiff.java
+1
-1
GenGeneratorXml.java
atms-gen/src/test/java/com/neo/GenGeneratorXml.java
+8
-2
No files found.
atms-dao/etc/generator-oracle/generatorConfig.xml
View file @
4a9abfa4
This diff is collapsed.
Click to expand it.
atms-dao/etc/generator-oracle/vatGeneratorConfig.xml
View file @
4a9abfa4
This diff is collapsed.
Click to expand it.
atms-gen/src/test/java/com/neo/ExtractCommitFromDiff.java
View file @
4a9abfa4
...
...
@@ -27,7 +27,7 @@ public class ExtractCommitFromDiff {
diff
=
new
Diff
();
diff
.
fileName
=
line
.
substring
(
line
.
lastIndexOf
(
"/ atms-dao"
)
+
1
,
line
.
length
());
}
else
if
(
line
.
startsWith
(
"+"
)
||
line
.
s
rtsWith
(
"-"
))
{
}
else
if
(
line
.
startsWith
(
"+"
)
||
line
.
s
ta
rtsWith
(
"-"
))
{
if
(
line
.
startsWith
(
"++"
)
||
line
.
startsWith
(
"--"
))
continue
;
if
(
diff
==
null
)
{
System
.
out
.
println
(
line
);
...
...
atms-gen/src/test/java/com/neo/GenGeneratorXml.java
View file @
4a9abfa4
...
...
@@ -16,6 +16,9 @@ import java.util.ArrayList;
import
java.util.Arrays
;
import
java.util.List
;
import
static
pwc
.
taxtech
.
Const
.
PROJECT_ADMIN
;
import
static
pwc
.
taxtech
.
Const
.
PROJECT_SCHEMA
;
public
class
GenGeneratorXml
{
public
static
final
boolean
IS_ADMIN
=
true
;
public
static
final
boolean
IS_VAT
=
false
;
...
...
@@ -52,6 +55,7 @@ public class GenGeneratorXml {
if
(
line
.
contains
(
"@Table"
))
{
System
.
out
.
println
(
"table line:"
+
line
);
table
.
tableName
=
extractName
(
line
);
table
.
schema
=
isAdmin
?
PROJECT_ADMIN
:
PROJECT_SCHEMA
;
}
else
if
(
line
.
contains
(
"class"
))
{
if
(
line
.
contains
(
"IdClass"
)
||
line
.
contains
(
"classCode"
))
continue
;
System
.
out
.
println
(
"entity line:"
+
line
);
...
...
@@ -88,11 +92,13 @@ public class GenGeneratorXml {
static
class
Table
{
String
tableName
;
String
entityName
;
String
schema
;
List
<
ColumnOverride
>
columnOverrides
=
new
ArrayList
<>();
@Override
public
String
toString
()
{
return
" <table tableName=\""
+
tableName
+
"\" domainObjectName=\""
+
entityName
+
"\">"
+
LINE_SPLITER
+
return
" <table tableName=\""
+
tableName
+
"\" schema=\""
+
schema
+
"\" "
+
"domainObjectName=\""
+
entityName
+
"\">"
+
LINE_SPLITER
+
" <property name=\"useActualColumnNames\" value=\"false\"/>"
+
LINE_SPLITER
+
" <property name=\"ignoreQualifiersAtRuntime\" value=\"true\"/>"
+
LINE_SPLITER
+
getColumnsString
()
+
...
...
@@ -218,7 +224,7 @@ public class GenGeneratorXml {
" PUBLIC \"-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN\"\n"
+
" \"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd\">\n"
+
"<generatorConfiguration>\n"
+
" <properties resource=\""
+(
isAdmin
?
"generator"
:
"vatGenerator"
)+
".properties\" />\n"
+
" <properties resource=\""
+
(
isAdmin
?
"generator"
:
"vatGenerator"
)
+
".properties\" />\n"
+
" <context id=\"contextId\" targetRuntime=\"MyBatis3\">\n"
+
" <property name=\"autoDelimitKeywords\" value=\"true\" />\n"
+
" <property name=\"beginningDelimiter\" value=\""
+
(
dbType
.
equals
(
ORACLE
)
?
"""
:
"`"
)
+
"\"/>\n"
+
...
...
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