db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r328873 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Column.java
Date Thu, 27 Oct 2005 13:43:34 GMT
Author: tomdz
Date: Thu Oct 27 06:43:31 2005
New Revision: 328873

URL: http://svn.apache.org/viewcvs?rev=328873&view=rev
Log:
Fix for default values

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Column.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Column.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Column.java?rev=328873&r1=328872&r2=328873&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Column.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Column.java Thu Oct 27 06:43:31 2005
@@ -46,9 +46,9 @@
     /** The name of the JDBC type. */
     private String _type;
     /** The size of the column for JDBC types that require/support this. */
-    private String _size = "0";
+    private String _size;
     /** The size of the column for JDBC types that require/support this. */
-    private int _sizeAsInt = 0;
+    private Integer _sizeAsInt;
     /** The scale of the column for JDBC types that require/support this. */
     private int _scale = 0;
     /** The default value. */
@@ -294,7 +294,7 @@
      */
     public int getSizeAsInt()
     {
-        return _sizeAsInt;
+        return _sizeAsInt == null ? 0 : _sizeAsInt.intValue();
     }
 
     /**
@@ -319,7 +319,13 @@
                 _size  = size.substring(0, pos);
                 _scale = Integer.parseInt(size.substring(pos + 1));
             }
-            _sizeAsInt = Integer.parseInt(_size);
+            _sizeAsInt = new Integer(_size);
+        }
+        else
+        {
+            _size      = null;
+            _sizeAsInt = null;
+            _scale     = 0;
         }
     }
     
@@ -350,7 +356,7 @@
      */
     public int getPrecisionRadix()
     {
-        return _sizeAsInt;
+        return getSizeAsInt();
     }
 
     /**
@@ -360,7 +366,7 @@
      */
     public void setPrecisionRadix(int precisionRadix)
     {
-        _sizeAsInt = precisionRadix;
+        _sizeAsInt = new Integer(precisionRadix);
         _size      = String.valueOf(precisionRadix);
     }
 



Mime
View raw message