db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1523774 - /db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSource.java
Date Mon, 16 Sep 2013 19:42:33 GMT
Author: tfischer
Date: Mon Sep 16 19:42:33 2013
New Revision: 1523774

URL: http://svn.apache.org/r1523774
Log:
TORQUE-303 Unknown datatype in generation of schema from database causes NPE

Modified:
    db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSource.java

Modified: db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSource.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSource.java?rev=1523774&r1=1523773&r2=1523774&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSource.java
(original)
+++ db/torque/torque4/trunk/torque-generator/src/main/java/org/apache/torque/generator/source/jdbc/JdbcMetadataSource.java
Mon Sep 16 19:42:33 2013
@@ -212,9 +212,11 @@ public class JdbcMetadataSource extends 
                     SourceElement column = new SourceElement("column");
                     column.setAttribute("name", name);
 
-                    column.setAttribute(
-                            "type",
-                            SchemaType.getByJdbcType(type).toString());
+                    SchemaType schemaType = SchemaType.getByJdbcType(type);
+                    if (schemaType != null)
+                    {
+                        column.setAttribute("type", schemaType.toString());
+                    }
 
                     if (size > 0 && (type.intValue() == Types.CHAR
                             || type.intValue() == Types.VARCHAR



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