Related to issue 24682. Cleanup of some unneeded methods. Added Operation exception to unsupported feature.
authorAntonio Moreno <antonio.moreno@openbravo.com>
Wed, 04 Sep 2013 17:26:02 +0200
changeset 460 bb0a0fbcfe5a
parent 459 1ee907d016ed
child 461 255f2e040a01
Related to issue 24682. Cleanup of some unneeded methods. Added Operation exception to unsupported feature.
src/org/apache/ddlutils/Platform.java
src/org/apache/ddlutils/platform/PlatformImplBase.java
src/org/openbravo/ddlutils/task/AlterDatabaseDataMod.java
--- a/src/org/apache/ddlutils/Platform.java	Wed Sep 04 10:03:01 2013 +0200
+++ b/src/org/apache/ddlutils/Platform.java	Wed Sep 04 17:26:02 2013 +0200
@@ -1355,27 +1355,11 @@
   public ModelBasedResultSetIterator createResultSetIterator(Database model, ResultSet resultSet,
       Table[] queryHints);
 
-  public void deleteInvalidConstraintRows(Database model, boolean continueOnError);
-
   public void deleteInvalidConstraintRows(Database model, OBDataset dataset, boolean continueOnError);
 
-  public void deleteAllInvalidConstraintRows(Database model, boolean continueOnError);
-
-  public void deleteAllInvalidConstraintRows(Database model, OBDataset dataset,
-      boolean continueOnError);
-
-  public void deleteInvalidConstraintRows(Connection connection, Database model,
-      boolean continueOnError);
-
   public void deleteInvalidConstraintRows(Connection connection, Database model, OBDataset dataset,
       boolean continueOnError);
 
-  public void deleteAllInvalidConstraintRows(Connection connection, Database model,
-      boolean continueOnError);
-
-  public void deleteAllInvalidConstraintRows(Connection connection, Database model,
-      OBDataset dataset, boolean continueOnError);
-
   public void applyConfigScript(Database database, Vector<Change> changes);
 
   public ModelLoader getModelLoader();
--- a/src/org/apache/ddlutils/platform/PlatformImplBase.java	Wed Sep 04 10:03:01 2013 +0200
+++ b/src/org/apache/ddlutils/platform/PlatformImplBase.java	Wed Sep 04 17:26:02 2013 +0200
@@ -3021,10 +3021,6 @@
     }
   }
 
-  public void deleteInvalidConstraintRows(Database model, boolean continueOnError) {
-    deleteInvalidConstraintRows(model, null, continueOnError);
-  }
-
   public void deleteInvalidConstraintRows(Database model, OBDataset dataset, boolean continueOnError) {
 
     Connection connection = borrowConnection();
@@ -3033,11 +3029,6 @@
 
   }
 
-  public void deleteInvalidConstraintRows(Connection connection, Database model,
-      boolean continueOnError) {
-    deleteInvalidConstraintRows(connection, model, null, continueOnError);
-  }
-
   public void deleteInvalidConstraintRows(Connection connection, Database model, OBDataset dataset,
       boolean continueOnError) {
 
@@ -3048,34 +3039,6 @@
     evaluateBatch(connection, buffer.toString(), continueOnError);
   }
 
-  public void deleteAllInvalidConstraintRows(Database model, boolean continueOnError) {
-    deleteAllInvalidConstraintRows(model, null, continueOnError);
-  }
-
-  public void deleteAllInvalidConstraintRows(Database model, OBDataset dataset,
-      boolean continueOnError) {
-
-    Connection connection = borrowConnection();
-    deleteAllInvalidConstraintRows(connection, model, dataset, continueOnError);
-    returnConnection(connection);
-
-  }
-
-  public void deleteAllInvalidConstraintRows(Connection connection, Database model,
-      boolean continueOnError) {
-    deleteAllInvalidConstraintRows(connection, model, null, continueOnError);
-  }
-
-  public void deleteAllInvalidConstraintRows(Connection connection, Database model,
-      OBDataset dataset, boolean continueOnError) {
-
-    StringWriter buffer = new StringWriter();
-
-    getSqlBuilder().setWriter(buffer);
-    getSqlBuilder().deleteInvalidConstraintRows(model, dataset, false);
-    evaluateBatch(connection, buffer.toString(), continueOnError);
-  }
-
   public void applyConfigScript(Database database, Vector<Change> changes) {
     StringWriter buffer = new StringWriter();
 
@@ -3406,7 +3369,8 @@
   }
 
   public String limitOneRow() {
-    return "";
+    throw new UnsupportedOperationException(
+        "limitOneRow method not yet implemented for this platform: " + getName());
   }
 
   public boolean validateOnCreateDefault(Connection connection, String onCreateDefault, Table table) {
--- a/src/org/openbravo/ddlutils/task/AlterDatabaseDataMod.java	Wed Sep 04 10:03:01 2013 +0200
+++ b/src/org/openbravo/ddlutils/task/AlterDatabaseDataMod.java	Wed Sep 04 17:26:02 2013 +0200
@@ -337,7 +337,7 @@
             !isFailonerror()));
       }
       getLog().info("Removing invalid rows.");
-      platform.deleteInvalidConstraintRows(completedb, !isFailonerror());
+      platform.deleteInvalidConstraintRows(completedb, null, !isFailonerror());
       for (int i = 0; i < dataChanges.size(); i++) {
         getLog().info("Executing update final script (NOT NULLs and dropping temporary tables)");
         platform.alterTablesPostScript(moduleOldModels.get(i), moduleModels.get(i),