Commit 4a9abfa4 authored by neo's avatar neo

[dev] used schema on table gen entity

parent 449aefa6
......@@ -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.startsWith("-")) {
if (line.startsWith("++") || line.startsWith("--")) continue;
if (diff == null) {
System.out.println(line);
......
......@@ -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) ? "&quot;" : "`") + "\"/>\n" +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment