empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1530199 - /empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java
Date Tue, 08 Oct 2013 09:18:48 GMT
Author: doebele
Date: Tue Oct  8 09:18:47 2013
New Revision: 1530199

URL: http://svn.apache.org/r1530199
Log:
EMPIREDB-194
new method insertStmt()

Modified:
    empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java

Modified: empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java
URL: http://svn.apache.org/viewvc/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java?rev=1530199&r1=1530198&r2=1530199&view=diff
==============================================================================
--- empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java (original)
+++ empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBSQLScript.java Tue Oct
 8 09:18:47 2013
@@ -116,6 +116,21 @@ public class DBSQLScript implements Iter
     }
     
     /**
+     * Inserts an entry in the list
+     * @param i index of the statement to replace
+     * @param stmt the new statement for this index, or NULL to remove the statement
+     */
+    public void insertStmt(int i, String stmt)
+    {
+        if (stmt==null)
+            throw new InvalidArgumentException("stmt", stmt);
+        if (i<0 || i>sqlCmdList.size())
+            throw new InvalidArgumentException("index", i);
+        // replace or remove statement
+        sqlCmdList.add(i, stmt);
+    }
+    
+    /**
      * Clears the script by removing all statements
      */
     public void clear()



Mime
View raw message