• R/O
  • HTTP
  • SSH
  • HTTPS

rapideact: Commit


Commit MetaInfo

Revision2164aaadfeec063c3f7e7df4c811f952ed971b8d (tree)
Time2017-06-17 17:52:16
Authorkuboryu <kuboryu@yaho...>
Commiterkuboryu

Log Message

20170617_2

Change Summary

Incremental Difference

--- a/com/rapide_act/CmnProps.java
+++ b/com/rapide_act/CmnProps.java
@@ -36,12 +36,70 @@ public class CmnProps{
3636 protected static final int DB_TYPE_POSTGRESQL = 4;
3737 protected static final int DB_TYPE_HIRDB = 5;
3838 protected static final int DB_TYPE_UNKNOWN = -1;
39- protected static final String [] DB_TYPE_NAME = {"ORACLE", "SQLSERVER", "MYSQL", "DB2", "POSTGRESQL", "HIRDB"};
40- protected static final String [] DB_SQL_QUOTEDS = {"\"", "[", "`", "\"", "\"", "\""};
41- protected static final String [] DB_SQL_QUOTEDE = {"\"", "]", "`", "\"", "\"", "\""};
42- protected static final String [] SQL_TERMINATOR = {";" + System.getProperty("line.separator"), System.getProperty("line.separator") + "GO" + System.getProperty("line.separator"), ";" + System.getProperty("line.separator"), ";", ";", ";"};
43- protected static final String [] SQL_PREFIX = {"@", ":r ", "source ", "", "", ""};
44- protected static final String [] SQL_COMMENT_MARK = {"--", "--", "--", "--", "--", "--"};
39+ protected static final String [] DB_TYPE_NAME = {
40+ "ORACLE",
41+ "SQLSERVER",
42+ "MYSQL",
43+ "DB2",
44+ "POSTGRESQL",
45+ "HIRDB"
46+ };
47+ protected static final String [] DB_SQL_QUOTEDS = {
48+ "\"",
49+ "[",
50+ "`",
51+ "\"",
52+ "\"",
53+ "\""
54+ };
55+ protected static final String [] DB_SQL_QUOTEDE = {
56+ "\"",
57+ "]",
58+ "`",
59+ "\"",
60+ "\"",
61+ "\""
62+ };
63+ protected static final String [] SQL_TERMINATOR = {
64+ ";" + System.getProperty("line.separator"),
65+ System.getProperty("line.separator") + "GO" + System.getProperty("line.separator"),
66+ ";" + System.getProperty("line.separator"),
67+ ";" + System.getProperty("line.separator"),
68+ ";" + System.getProperty("line.separator"),
69+ ";" + System.getProperty("line.separator")
70+ };
71+ protected static final String [] SQL_TERMINATOR2 = {
72+ ";",
73+ System.getProperty("line.separator") + "GO",
74+ ";",
75+ ";",
76+ ";",
77+ ";"
78+ };
79+ protected static final String [] SQL_PREFIX = {
80+ "@",
81+ ":r ",
82+ "source ",
83+ "",
84+ "",
85+ ""
86+ };
87+ protected static final String [] SQL_COMMENT_MARK = {
88+ "--",
89+ "--",
90+ "--",
91+ "--",
92+ "--",
93+ "--"
94+ };
95+ protected static final String [] DROP_OPTION = {
96+ " CASCADE CONSTRAINT PURGE",
97+ "",
98+ "",
99+ "",
100+ "",
101+ ""
102+ };
45103 protected static final int MASK_PTN_ALL = 0;
46104 protected static final int MASK_PTN_ALT = 1;
47105 protected static final int MASK_PTN_EDGE = 2;
@@ -127,7 +185,6 @@ public class CmnProps{
127185 "OBJDEF",
128186 "FKDEF"
129187 };
130- protected static final String [] DROP_OPTION = {" CASCADE CONSTRAINT PURGE", "", "", "", "", ""};
131188
132189 protected static final String [] SQL_FILE_NAME = {
133190 "createTable.sql",
--- a/com/rapide_act/RapideMetaLoader.java
+++ b/com/rapide_act/RapideMetaLoader.java
@@ -108,7 +108,7 @@ public class RapideMetaLoader{
108108 flName = CmnUtils.splitDot(inFiles[k].getName());
109109 tbName = flName[0];
110110 executeSqlFile(dao, stmt, subFolder + "/" + inFiles[k].getName(), cp, false, false);
111- CmnUtils.infoPrint(String.format("%1$-30s",tbName) + " メタデータがロードされました。");
111+ CmnUtils.infoPrint(String.format("%1$-42s","[TABLE] " + tbName) + " メタデータがロードされました。");
112112 }
113113 }
114114 executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_PKEY], cp, false, false);
@@ -122,7 +122,7 @@ public class RapideMetaLoader{
122122 flName = CmnUtils.splitDot(inFiles[k].getName());
123123 viewName = flName[0];
124124 executeSqlFile(dao, stmt, subFolder + "/" + inFiles[k].getName(), cp, false, false);
125- CmnUtils.infoPrint(String.format("%1$-30s",viewName) + " メタデータがロードされました。");
125+ CmnUtils.infoPrint(String.format("%1$-42s","[VIEW] " + viewName) + " メタデータがロードされました。");
126126 }
127127 }
128128 subFolder = new File(folder + "/PROCEDURES");
@@ -133,7 +133,7 @@ public class RapideMetaLoader{
133133 flName = CmnUtils.splitDot(inFiles[k].getName());
134134 procName = flName[0];
135135 executeSqlFile(dao, stmt, subFolder + "/" + inFiles[k].getName(), cp, false, true);
136- CmnUtils.infoPrint(String.format("%1$-30s",procName) + " メタデータがロードされました。");
136+ CmnUtils.infoPrint(String.format("%1$-42s","[PROCEDURE] " + procName) + " メタデータがロードされました。");
137137 }
138138 }
139139 executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SYNONYM], cp, false, false);
@@ -211,7 +211,11 @@ public class RapideMetaLoader{
211211 }
212212 }
213213 } else {
214- sqlLine = CmnUtils.split(strMltLine, _cp.SQL_TERMINATOR[_cp.dbType]);
214+ if (_cp.dbType == _cp.DB_TYPE_MYSQL){
215+ sqlLine = CmnUtils.split(strMltLine, _cp.SQL_TERMINATOR[_cp.dbType]);
216+ } else {
217+ sqlLine = CmnUtils.split(strMltLine, _cp.SQL_TERMINATOR2[_cp.dbType]);
218+ }
215219 for(int l = 0;l<sqlLine.length;l++){
216220 if(!sqlLine[l].equals("")){
217221 try {
--- a/com/rapide_act/RapideMetaUnloader.java
+++ b/com/rapide_act/RapideMetaUnloader.java
@@ -275,7 +275,7 @@ public class RapideMetaUnloader{
275275 for(int i=0;i<strSplit[TBL_COMMENTS].length;i++)if(!strSplit[TBL_COMMENTS][i].trim().equals(""))pw[CONTENTS].println(strSplit[TBL_COMMENTS][i]);
276276 pw[CONTENTS].close();
277277 pw[CONTENTS] = null;
278- CmnUtils.infoPrint(String.format("%1$-30s",tableName) + " メタデータがアンロードされました。");
278+ CmnUtils.infoPrint(String.format("%1$-42s","[TABLE] " + tableName) + " メタデータがアンロードされました。");
279279 sbTbCnts = new StringBuffer();
280280 sbTbCmnt = new StringBuffer();
281281 sbTbCnts.append("CREATE TABLE " + cp.DB_SQL_QUOTEDS[cp.dbType]+ strSplit[LINE][COL01] + cp.DB_SQL_QUOTEDE[cp.dbType]);
@@ -355,7 +355,7 @@ public class RapideMetaUnloader{
355355 for(int i=0;i<strSplit[TBL_COMMENTS].length;i++)if(!strSplit[TBL_COMMENTS][i].trim().equals(""))pw[CONTENTS].println(strSplit[TBL_COMMENTS][i]);
356356 pw[CONTENTS].close();
357357 pw[CONTENTS] = null;
358- CmnUtils.infoPrint(String.format("%1$-30s",tableName) + " メタデータがアンロードされました。");
358+ CmnUtils.infoPrint(String.format("%1$-42s","[TABLE] " + tableName) + " メタデータがアンロードされました。");
359359 }
360360 for(int i=0;i<pw.length;i++){
361361 if(pw[i]!=null){
@@ -603,7 +603,7 @@ public class RapideMetaUnloader{
603603 }
604604 pw[CONTENTS].close();
605605 pw[CONTENTS] = null;
606- CmnUtils.infoPrint(String.format("%1$-30s",strSplit[LINE][COL01]) + " メタデータがアンロードされました。");
606+ CmnUtils.infoPrint(String.format("%1$-42s", "[VIEW] " + strSplit[LINE][COL01]) + " メタデータがアンロードされました。");
607607 }
608608 for(int i=0;i<pw.length;i++){
609609 if(pw[i]!=null){
@@ -689,7 +689,7 @@ public class RapideMetaUnloader{
689689 }
690690 pw[CONTENTS].close();
691691 pw[CONTENTS] = null;
692- CmnUtils.infoPrint(String.format("%1$-30s",strSplit[LINE][COL01]) + " メタデータがアンロードされました。");
692+ CmnUtils.infoPrint(String.format("%1$-42s","[PROCEDURE] " + strSplit[LINE][COL01]) + " メタデータがアンロードされました。");
693693 }
694694 for(int i=0;i<pw.length;i++){
695695 if(pw[i]!=null){
Show on old repository browser