From 73fcd672de45136b937e355058612ae23671d5f6 Mon Sep 17 00:00:00 2001 From: kuboryu Date: Sat, 1 Jul 2017 16:27:17 +0900 Subject: [PATCH] 20170701 --- com/rapide_act/CmnProps.java | 3 +++ com/rapide_act/RapideMetaLoader.java | 27 ++++++++++++++------------- com/rapide_act/RapideMetaUnloader.java | 4 +++- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/com/rapide_act/CmnProps.java b/com/rapide_act/CmnProps.java index 6d35fc9..4936a8a 100644 --- a/com/rapide_act/CmnProps.java +++ b/com/rapide_act/CmnProps.java @@ -543,6 +543,7 @@ public class CmnProps{ + " and c.constraint_name = d.constraint_name" + " and a.r_owner = c.owner" + " and a.r_constraint_name = c.constraint_name" + + " and b.position = d.position" + " order by" + " a.table_name,a.constraint_name,b.position,d.position" }, @@ -785,6 +786,7 @@ public class CmnProps{ + " and a.constraint_name = b.constraint_name " + " and b.referenced_table_name = c.table_name " + " and b.referenced_column_name = c.column_name " + + " and b.ordinal_position = c.ordinal_position" }, { //DB2 "select " @@ -906,6 +908,7 @@ public class CmnProps{ + " and a.refkeyname = c.constname" + " and a.reftabschema = c.tabschema" + " and a.reftabname = c.tabname" + + " and b.colseq = c.colseq" + " order by" + " a.tabname,a.constname,b.colseq,c.colseq" } diff --git a/com/rapide_act/RapideMetaLoader.java b/com/rapide_act/RapideMetaLoader.java index 49e0c55..2daa4ab 100644 --- a/com/rapide_act/RapideMetaLoader.java +++ b/com/rapide_act/RapideMetaLoader.java @@ -100,6 +100,7 @@ public class RapideMetaLoader{ executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.DROP_SEQUENCE], cp, true, false); executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.DROP_TABLE], cp, true, false); } + subFolder = new File(folder + "/TABLES"); inFiles = subFolder.listFiles(); tb_count = 0; @@ -114,6 +115,10 @@ public class RapideMetaLoader{ executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_PKEY], cp, false, false); executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_UKEY], cp, false, false); executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_INDEX], cp, false, false); + executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SYNONYM], cp, false, false); + executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SEQUENCE], cp, false, false); + executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_FK], cp, false, false); + subFolder = new File(folder + "/VIEWS"); inFiles = subFolder.listFiles(); int view_count = 0; @@ -136,9 +141,6 @@ public class RapideMetaLoader{ CmnUtils.infoPrint(String.format("%1$-42s","[PROCEDURE] " + procName) + " ƒƒ^ƒf[ƒ^‚ªƒ[ƒh‚³‚ê‚Ü‚µ‚½B"); } } - executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SYNONYM], cp, false, false); - executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_SEQUENCE], cp, false, false); - executeSqlFile(dao, stmt, folder + "/" + cp.SQL_FILE_NAME[cp.CREATE_FK], cp, false, false); CmnUtils.infoPrint("ƒƒ^ƒf[ƒ^ƒ[ƒh‚ðI—¹‚µ‚Ü‚µ‚½B"); @@ -185,21 +187,20 @@ public class RapideMetaLoader{ while((strLine=br.readLine()) != null){ if (_cp.dbType == _cp.DB_TYPE_SQLSERVER){ if(!strLine.equals("GO")){ - strMltLine += _cp.inColLineSeparator + strLine; + strMltLine += _cp.lineSeparator + strLine; } } else { - strMltLine += _cp.inColLineSeparator + strLine; + if(!strMltLine.equals("")){ + strMltLine += _cp.lineSeparator + strLine; + } else { + strMltLine += strLine; + } } } - strMltLine += _cp.lineSeparator; if(_isReplace){ if(!strMltLine.equals("")){ try { - if (_cp.dbType == _cp.DB_TYPE_ORACLE){ - _stmt = _dao.prepareSql(strMltLine.replaceAll("\r","")); - } else { - _stmt = _dao.prepareSql(strMltLine); - } + _stmt = _dao.prepareSql(strMltLine.replaceAll("\r","")); _stmt.executeUpdate(); if(_stmt != null){ _stmt.close(); @@ -212,11 +213,11 @@ public class RapideMetaLoader{ } } } else { + strMltLine += _cp.lineSeparator; sqlLine = CmnUtils.split(strMltLine, _cp.SQL_TERMINATOR[_cp.dbType]); for(int l = 0;l