db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r422173 - in /db/torque: generator/trunk/src/java/org/apache/torque/task/TorqueJDBCTransformTask.java site/trunk/xdocs/changes.xml
Date Sat, 15 Jul 2006 08:02:04 GMT
Author: tfischer
Date: Sat Jul 15 01:02:03 2006
New Revision: 422173

URL: http://svn.apache.org/viewvc?rev=422173&view=rev
Log:
Caught SQL exception when foreign keys cannot be retrieved in the jdbc task.
Thanks to Thorals Rickert for reporting teh error and suggesting a solution.
Fixes TORQUE-41

Modified:
    db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueJDBCTransformTask.java
    db/torque/site/trunk/xdocs/changes.xml

Modified: db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueJDBCTransformTask.java
URL: http://svn.apache.org/viewvc/db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueJDBCTransformTask.java?rev=422173&r1=422172&r2=422173&view=diff
==============================================================================
--- db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueJDBCTransformTask.java
(original)
+++ db/torque/generator/trunk/src/java/org/apache/torque/task/TorqueJDBCTransformTask.java
Sat Jul 15 01:02:03 2006
@@ -31,6 +31,7 @@
 import java.util.List;
 
 import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
 import org.apache.tools.ant.Task;
 import org.apache.torque.engine.database.model.TypeMap;
 import org.apache.torque.engine.database.transform.DTDResolver;
@@ -513,6 +514,16 @@
                 ref[1] = foreignKeys.getString(4); //foreign column
                 refs.add(ref);
             }
+        }
+        catch (SQLException e)
+        {
+            // this seems to be happening in some db drivers (sybase)
+            // when retrieving foreign keys from views.
+            log("WARN: Could not read foreign keys for Table " 
+                        + tableName
+                        + " : "
+                        + e.getMessage(), 
+                    Project.MSG_WARN);
         }
         finally
         {

Modified: db/torque/site/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/db/torque/site/trunk/xdocs/changes.xml?rev=422173&r1=422172&r2=422173&view=diff
==============================================================================
--- db/torque/site/trunk/xdocs/changes.xml (original)
+++ db/torque/site/trunk/xdocs/changes.xml Sat Jul 15 01:02:03 2006
@@ -29,6 +29,11 @@
 
   <release version="3.2.1-dev" date="in SVN">
   
+    <action type="fix" dev="tfischer" issue="TORQUE-41" due-to="Thoralf Rickert">
+      Caught SQL exception when foreign keys for a table or view 
+      cannot be retrieved in the jdbc ant task in the generator.
+      Now a warning is printed instead of stopping execution.
+    </action>
     <action type="add" dev="tfischer" issue="TORQUE-33" due-to="Jacob Champlin">
       Refined guesswork for detecting column names out of functions, clauses
       etc. This is important e.g. for orderBy Statements like



---------------------------------------------------------------------
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