• R/O
  • HTTP
  • SSH
  • HTTPS

rapideact: Commit


Commit MetaInfo

Revision73fcd672de45136b937e355058612ae23671d5f6 (tree)
Time2017-07-01 16:27:17
Authorkuboryu <kuboryu@yaho...>
Commiterkuboryu

Log Message

20170701

Change Summary

Incremental Difference

--- a/com/rapide_act/CmnProps.java
+++ b/com/rapide_act/CmnProps.java
@@ -543,6 +543,7 @@ public class CmnProps{
543543 + " and c.constraint_name = d.constraint_name"
544544 + " and a.r_owner = c.owner"
545545 + " and a.r_constraint_name = c.constraint_name"
546+ + " and b.position = d.position"
546547 + " order by"
547548 + " a.table_name,a.constraint_name,b.position,d.position"
548549 },
@@ -785,6 +786,7 @@ public class CmnProps{
785786 + " and a.constraint_name = b.constraint_name "
786787 + " and b.referenced_table_name = c.table_name "
787788 + " and b.referenced_column_name = c.column_name "
789+ + " and b.ordinal_position = c.ordinal_position"
788790 },
789791 { //DB2
790792 "select "
@@ -906,6 +908,7 @@ public class CmnProps{
906908 + " and a.refkeyname = c.constname"
907909 + " and a.reftabschema = c.tabschema"
908910 + " and a.reftabname = c.tabname"
911+ + " and b.colseq = c.colseq"
909912 + " order by"
910913 + " a.tabname,a.constname,b.colseq,c.colseq"
911914 }
--- a/com/rapide_act/RapideMetaLoader.java
+++ b/com/rapide_act/RapideMetaLoader.java
@@ -100,6 +100,7 @@ public class RapideMetaLoader{
100100 executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.DROP_SEQUENCE], cp, true, false);
101101 executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.DROP_TABLE], cp, true, false);
102102 }
103+
103104 subFolder = new File(folder + "/TABLES");
104105 inFiles = subFolder.listFiles();
105106 tb_count = 0;
@@ -114,6 +115,10 @@ public class RapideMetaLoader{
114115 executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_PKEY], cp, false, false);
115116 executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_UKEY], cp, false, false);
116117 executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_INDEX], cp, false, false);
118+ executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SYNONYM], cp, false, false);
119+ executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SEQUENCE], cp, false, false);
120+ executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_FK], cp, false, false);
121+
117122 subFolder = new File(folder + "/VIEWS");
118123 inFiles = subFolder.listFiles();
119124 int view_count = 0;
@@ -136,9 +141,6 @@ public class RapideMetaLoader{
136141 CmnUtils.infoPrint(String.format("%1$-42s","[PROCEDURE] " + procName) + " メタデータがロードされました。");
137142 }
138143 }
139- executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SYNONYM], cp, false, false);
140- executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SEQUENCE], cp, false, false);
141- executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_FK], cp, false, false);
142144
143145 CmnUtils.infoPrint("メタデータロードを終了しました。");
144146
@@ -185,21 +187,20 @@ public class RapideMetaLoader{
185187 while((strLine=br.readLine()) != null){
186188 if (_cp.dbType == _cp.DB_TYPE_SQLSERVER){
187189 if(!strLine.equals("GO")){
188- strMltLine += _cp.inColLineSeparator + strLine;
190+ strMltLine += _cp.lineSeparator + strLine;
189191 }
190192 } else {
191- strMltLine += _cp.inColLineSeparator + strLine;
193+ if(!strMltLine.equals("")){
194+ strMltLine += _cp.lineSeparator + strLine;
195+ } else {
196+ strMltLine += strLine;
197+ }
192198 }
193199 }
194- strMltLine += _cp.lineSeparator;
195200 if(_isReplace){
196201 if(!strMltLine.equals("")){
197202 try {
198- if (_cp.dbType == _cp.DB_TYPE_ORACLE){
199- _stmt = _dao.prepareSql(strMltLine.replaceAll("\r",""));
200- } else {
201- _stmt = _dao.prepareSql(strMltLine);
202- }
203+ _stmt = _dao.prepareSql(strMltLine.replaceAll("\r",""));
203204 _stmt.executeUpdate();
204205 if(_stmt != null){
205206 _stmt.close();
@@ -212,11 +213,11 @@ public class RapideMetaLoader{
212213 }
213214 }
214215 } else {
216+ strMltLine += _cp.lineSeparator;
215217 sqlLine = CmnUtils.split(strMltLine, _cp.SQL_TERMINATOR[_cp.dbType]);
216218 for(int l = 0;l<sqlLine.length;l++){
217- if(!sqlLine[l].equals("") && !sqlLine[l].equals(_cp.lineSeparator)){
219+ if(!CmnUtils.isEmpty(sqlLine[l]) && !sqlLine[l].equals(_cp.lineSeparator)){
218220 try {
219- CmnUtils.debugPrint("'" + sqlLine[l] + "'");
220221 if (_cp.dbType == _cp.DB_TYPE_ORACLE){
221222 _stmt = _dao.prepareSql(sqlLine[l].replaceAll("\r",""));
222223 } else {
--- a/com/rapide_act/RapideMetaUnloader.java
+++ b/com/rapide_act/RapideMetaUnloader.java
@@ -804,7 +804,9 @@ public class RapideMetaUnloader{
804804 } else {
805805 pw[CREATE].print(cp.DB_SQL_QUOTEDS[cp.dbType] + tbOwner + cp.DB_SQL_QUOTEDE[cp.dbType] + "." + cp.DB_SQL_QUOTEDS[cp.dbType]+ tbName + cp.DB_SQL_QUOTEDE[cp.dbType]);
806806 }
807- } else {
807+ } else if(cp.dbType == cp.DB_TYPE_SQLSERVER){
808+ pw[CREATE].print(tbName);
809+ } else if(cp.dbType == cp.DB_TYPE_DB2){
808810 pw[CREATE].print(cp.DB_SQL_QUOTEDS[cp.dbType] + tbName + cp.DB_SQL_QUOTEDE[cp.dbType]);
809811 }
810812 pw[CREATE].print(cp.SQL_TERMINATOR[cp.dbType]);
Show on old repository browser