db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r399371 - /db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java
Date Wed, 03 May 2006 18:26:46 GMT
Author: tfischer
Date: Wed May  3 11:26:43 2006
New Revision: 399371

URL: http://svn.apache.org/viewcvs?rev=399371&view=rev
Log:
- removed unused property sqlCommand
- deprecated method addText as it has no effect
- replaced a few log() calls by System.out.println() calls in order to get some diagnostic
output in the maven 2 plugin

Modified:
    db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java

Modified: db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java
URL: http://svn.apache.org/viewcvs/db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java?rev=399371&r1=399370&r2=399371&view=diff
==============================================================================
--- db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java (original)
+++ db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueSQLExec.java Wed May 
3 11:26:43 2006
@@ -104,9 +104,6 @@
     /** Password */
     private String password = null;
 
-    /** SQL input command */
-    private String sqlCommand = "";
-
     /** SQL Statement delimiter */
     private String delimiter = ";";
 
@@ -228,6 +225,8 @@
      * Set the sql command to execute
      *
      * @param sql sql command to execute
+     * @deprecated This method has no effect and
+     *             will be removed in a future version.
      */
     public void addText(String sql)
     {
@@ -387,8 +386,6 @@
      */
     public void execute() throws BuildException
     {
-        sqlCommand = sqlCommand.trim();
-
         if (sqldbmap == null || getSqlDbMap().exists() == false)
         {
             throw new BuildException("You haven't provided an sqldbmap, or "
@@ -474,7 +471,7 @@
                 }
                 else
                 {
-                    super.log("File '" + fileName
+                    System.out.println("File '" + file.getAbsolutePath()
                             + "' in sqldbmap does not exist, so skipping it.");
                 }
             }
@@ -569,7 +566,8 @@
                 // Process all transactions
                 for (Iterator it = transactions.iterator(); it.hasNext();)
                 {
-                    ((Transaction) it.next()).runTransaction(out);
+                    Transaction transaction = (Transaction) it.next();
+                    transaction.runTransaction(out);
                     if (!autocommit)
                     {
                         log("Commiting transaction", Project.MSG_VERBOSE);
@@ -633,7 +631,7 @@
             }
         }
 
-        log(goodSql + " of " + totalSql
+        System.out.println(goodSql + " of " + totalSql
                 + " SQL statements executed successfully");
     }
 
@@ -802,7 +800,7 @@
         }
         catch (SQLException e)
         {
-            log("Failed to execute: " + sql, Project.MSG_ERR);
+            System.out.println("Failed to execute: " + sql);
             if (!onError.equals("continue"))
             {
                 throw e;
@@ -876,9 +874,15 @@
      */
     public static class OnError extends EnumeratedAttribute
     {
+        public static final String CONTINUE = "continue";
+        
+        public static final String STOP = "stop";
+
+        public static final String ABORT = "abort";
+        
         public String[] getValues()
         {
-            return new String[] {"continue", "stop", "abort"};
+            return new String[] {CONTINUE, STOP, ABORT};
         }
     }
 
@@ -914,8 +918,7 @@
 
             if (tSrcFile != null)
             {
-                log("Executing file: " + tSrcFile.getAbsolutePath(),
-                    Project.MSG_INFO);
+                System.out.println("Executing file: " + tSrcFile.getAbsolutePath());
                 Reader reader = (encoding == null) ? new FileReader(tSrcFile)
                         : new InputStreamReader(new FileInputStream(tSrcFile),
                         encoding);



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message