db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r366026 - in /db/ddlutils/trunk/src: java/org/apache/ddlutils/PlatformInfo.java test/org/apache/ddlutils/io/RoundtripTestBase.java
Date Wed, 04 Jan 2006 23:32:16 GMT
Author: tomdz
Date: Wed Jan  4 15:32:09 2006
New Revision: 366026

URL: http://svn.apache.org/viewcvs?rev=366026&view=rev
Log:
Changed flag for synthetic default values so that it now marks when these values are returned
for non-identity required columns (of which primary key columns are a subset)

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java?rev=366026&r1=366025&r2=366026&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java Wed Jan  4 15:32:09 2006
@@ -115,8 +115,8 @@
         reading a model from a database. */
     private boolean _returningSystemIndices = true;
 
-    /** Whether the database returns a synthetic default value for primary key columns. */

-    private boolean _returningDefaultValueForPrimaryKeys = false;
+    /** Whether the database returns a synthetic default value for non-identity required
columns. */ 
+    private boolean _returningDefaultValueForRequired = false;
     
     /**
      * Creates a new platform info object.
@@ -826,25 +826,26 @@
 
     /**
      * Determines whether the platform returns synthetic default values (e.g. 0 for numeric
-     * columns etc.) for primary key columns when reading a model from a database.
+     * columns etc.) for non-identity required columns when reading a model from a database.
      *
-     * @return <code>true</code> if synthetic default values are returned for
pk columns
+     * @return <code>true</code> if synthetic default values are returned for
non-identity 
+     *         required columns
      */
-    public boolean isReturningDefaultValueForPrimaryKeys()
+    public boolean isReturningDefaultValueForRequired()
     {
-        return _returningDefaultValueForPrimaryKeys;
+        return _returningDefaultValueForRequired;
     }
 
     /**
      * Specifies whether the platform returns synthetic default values (e.g. 0 for numeric
-     * columns etc.) for primary key columns when reading a model from a database.
+     * columns etc.) for non-identity required columns when reading a model from a database.
      *
      * @param returningDefaultValue <code>true</code> if synthetic default values
are returned for
-     *                              pk columns
+     *                              non-identity required columns
      */
-    public void setReturningDefaultValueForPrimaryKeys(boolean returningDefaultValue)
+    public void setReturningDefaultValueForRequired(boolean returningDefaultValue)
     {
-        _returningDefaultValueForPrimaryKeys = returningDefaultValue;
+        _returningDefaultValueForRequired = returningDefaultValue;
     }
 
 }

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java?rev=366026&r1=366025&r2=366026&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java Wed Jan  4 15:32:09
2006
@@ -133,8 +133,8 @@
                     }
                     // finally the platform might return a synthetic default value if the
column
                     // is a primary key column
-                    if (getPlatformInfo().isReturningDefaultValueForPrimaryKeys() &&
-                        (column.getDefaultValue() == null) && column.isPrimaryKey())
+                    if (getPlatformInfo().isReturningDefaultValueForRequired() &&
+                        (column.getDefaultValue() == null) && column.isRequired()
&& !column.isAutoIncrement())
                     {
                         switch (column.getTypeCode())
                         {



Mime
View raw message