ddlutils-dev

[Prev] Thread [Next]  |  [Prev] Date [Next]

svn commit: r712002 - in /db/ddlutils/trunk/src: main/java/org/apache/ddlutils/platform/ main/java/org/apache/ddlutils/platform/firebird/ main/java/org/apache/ddlutils/platform/hsqldb/ main/java/org/apache/ddlutils/platform/mssql/ main/java/org/apache/... tomdz Thu Nov 06 15:01:18 2008

Author: tomdz
Date: Thu Nov  6 14:53:59 2008
New Revision: 712002

URL: http://svn.apache.org/viewvc?rev=712002&view=rev
Log:
Fixed Firebird platform
Tweaked tests 

Modified:
    
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/PlatformImplBase.java
    db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/SqlBuilder.java
    
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/firebird/FirebirdBuilder.java
    
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/firebird/FirebirdPlatform.java
    
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/hsqldb/HsqlDbBuilder.java
    
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/mssql/MSSqlBuilder.java
    
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/postgresql/PostgreSqlBuilder.java
    db/ddlutils/trunk/src/test/java/org/apache/ddlutils/io/TestAddColumn.java

Modified: 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/PlatformImplBase.java
URL: 
http://svn.apache.org/viewvc/db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/PlatformImplBase.java?rev=712002&r1=712001&r2=712002&view=diff
==============================================================================
--- 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/PlatformImplBase.java
 (original)
+++ 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/PlatformImplBase.java
 Thu Nov  6 14:53:59 2008
@@ -1410,7 +1410,7 @@
     {
         Table changedTable = findChangedTable(currentModel, change);
 
-        getSqlBuilder().addColumn(changedTable, change.getNewColumn());
+        getSqlBuilder().addColumn(currentModel, changedTable, 
change.getNewColumn());
         change.apply(currentModel, isDelimitedIdentifierModeOn());
     }
 

Modified: 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/SqlBuilder.java
URL: 
http://svn.apache.org/viewvc/db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/SqlBuilder.java?rev=712002&r1=712001&r2=712002&view=diff
==============================================================================
--- 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/SqlBuilder.java 
(original)
+++ 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/SqlBuilder.java 
Thu Nov  6 14:53:59 2008
@@ -718,10 +718,11 @@
     /**
      * Prints the SQL for adding a column to a table.
      * 
+     * @param model     The database model
      * @param table     The table
      * @param newColumn The new column
      */
-    public void addColumn(Table table, Column newColumn) throws IOException
+    public void addColumn(Database model, Table table, Column newColumn) 
throws IOException
     {
         print("ALTER TABLE ");
         printlnIdentifier(getTableName(table));

Modified: 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/firebird/FirebirdBuilder.java
URL: 
http://svn.apache.org/viewvc/db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/firebird/FirebirdBuilder.java?rev=712002&r1=712001&r2=712002&view=diff
==============================================================================
--- 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/firebird/FirebirdBuilder.java
 (original)
+++ 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/firebird/FirebirdBuilder.java
 Thu Nov  6 14:53:59 2008
@@ -24,10 +24,12 @@
 import java.util.Map;
 
 import org.apache.ddlutils.Platform;
+import org.apache.ddlutils.alteration.ColumnDefinitionChange;
 import org.apache.ddlutils.model.Column;
 import org.apache.ddlutils.model.Database;
 import org.apache.ddlutils.model.Index;
 import org.apache.ddlutils.model.Table;
+import org.apache.ddlutils.model.TypeMap;
 import org.apache.ddlutils.platform.SqlBuilder;
 
 /**
@@ -211,6 +213,23 @@
     }
 
     /**
+     * [EMAIL PROTECTED]
+     */
+    public void addColumn(Database model, Table table, Column newColumn) 
throws IOException
+    {
+        print("ALTER TABLE ");
+        printlnIdentifier(getTableName(table));
+        printIndent();
+        print("ADD ");
+        writeColumn(table, newColumn);
+        printEndOfStatement();
+        if (newColumn.isAutoIncrement())
+        {
+            writeAutoIncrementCreateStmts(model, table, newColumn);
+        }
+    }
+
+    /**
      * Writes the SQL to add/insert a column.
      * 
      * @param model      The database model
@@ -221,30 +240,25 @@
      */
     public void insertColumn(Database model, Table table, Column newColumn, 
Column prevColumn) throws IOException
     {
-        print("ALTER TABLE ");
-        printlnIdentifier(getTableName(table));
-        printIndent();
-        print("ADD ");
-        writeColumn(table, newColumn);
-        printEndOfStatement();
+        addColumn(model, table, newColumn);
+
+        // column positions start at 1 in Firebird
+        int pos = 1;
 
         if (prevColumn != null)
         {
-            // Even though Firebird can only add columns, we can move them 
later on
-            print("ALTER TABLE ");
-            printlnIdentifier(getTableName(table));
-            printIndent();
-            print("ALTER ");
-            printIdentifier(getColumnName(newColumn));
-            print(" POSITION ");
-            // column positions start at 1 in Firebird
-            print(String.valueOf(table.getColumnIndex(prevColumn) + 2));
-            printEndOfStatement();
-        }
-        if (newColumn.isAutoIncrement())
-        {
-            writeAutoIncrementCreateStmts(model, table, newColumn);
+            pos = table.getColumnIndex(prevColumn) + 2;
         }
+
+        // Even though Firebird can only add columns, we can move them later on
+        print("ALTER TABLE ");
+        printlnIdentifier(getTableName(table));
+        printIndent();
+        print("ALTER ");
+        printIdentifier(getColumnName(newColumn));
+        print(" POSITION ");
+        print(String.valueOf(pos));
+        printEndOfStatement();
     }
 
     /**
@@ -266,4 +280,42 @@
         printIdentifier(getColumnName(column));
         printEndOfStatement();
     }
+
+    /**
+     * [EMAIL PROTECTED]
+     */
+    protected void writeCastExpression(Column sourceColumn, Column 
targetColumn) throws IOException
+    {
+        boolean sizeChanged = 
ColumnDefinitionChange.isSizeChanged(getPlatformInfo(), sourceColumn, 
targetColumn);
+        boolean typeChanged = 
ColumnDefinitionChange.isTypeChanged(getPlatformInfo(), sourceColumn, 
targetColumn);
+
+        if (sizeChanged || typeChanged)
+        {
+            boolean needSubstr = 
TypeMap.isTextType(targetColumn.getTypeCode()) && sizeChanged &&
+                                 (targetColumn.getSize() != null) && 
(sourceColumn.getSizeAsInt() > targetColumn.getSizeAsInt());
+
+            if (needSubstr)
+            {
+                print("SUBSTRING(");
+            }
+            // we're not using CAST but instead string construction which does 
not require us to know the size
+            print("(");
+            printIdentifier(getColumnName(sourceColumn));
+            print(" || '' ");
+            if (needSubstr)
+            {
+                print(") FROM 1 FOR ");
+                print(targetColumn.getSize());
+                print(")");
+            }
+            else
+            {
+                print(")");
+            }
+        }
+        else
+        {
+            super.writeCastExpression(sourceColumn, targetColumn);
+        }
+    }
 }

Modified: 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/firebird/FirebirdPlatform.java
URL: 
http://svn.apache.org/viewvc/db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/firebird/FirebirdPlatform.java?rev=712002&r1=712001&r2=712002&view=diff
==============================================================================
--- 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/firebird/FirebirdPlatform.java
 (original)
+++ 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/firebird/FirebirdPlatform.java
 Thu Nov  6 14:53:59 2008
@@ -33,6 +33,7 @@
 import org.apache.ddlutils.alteration.RemoveColumnChange;
 import org.apache.ddlutils.alteration.TableChange;
 import org.apache.ddlutils.alteration.TableDefinitionChangesPredicate;
+import org.apache.ddlutils.model.CascadeActionEnum;
 import org.apache.ddlutils.model.Column;
 import org.apache.ddlutils.model.Database;
 import org.apache.ddlutils.model.Table;
@@ -67,6 +68,8 @@
         info.setPrimaryKeyColumnAutomaticallyRequired(true);
         info.setCommentPrefix("/*");
         info.setCommentSuffix("*/");
+        info.setSupportedOnUpdateActions(new CascadeActionEnum[] { 
CascadeActionEnum.CASCADE, CascadeActionEnum.SET_DEFAULT, 
CascadeActionEnum.SET_NULL, CascadeActionEnum.NONE });
+        info.setSupportedOnDeleteActions(new CascadeActionEnum[] { 
CascadeActionEnum.CASCADE, CascadeActionEnum.SET_DEFAULT, 
CascadeActionEnum.SET_NULL, CascadeActionEnum.NONE });
 
         info.addNativeTypeMapping(Types.ARRAY,         "BLOB",               
Types.LONGVARBINARY);
         info.addNativeTypeMapping(Types.BINARY,        "BLOB",               
Types.LONGVARBINARY);
@@ -172,14 +175,18 @@
                 // Firebird cannot add columns to the primary key or drop 
columns from it but
                 // since we add/drop the primary key with separate changes 
anyways, this will
                 // no problem here
-                if ((change instanceof RemoveColumnChange) ||
-                    (change instanceof AddColumnChange))
+                if (change instanceof AddColumnChange)
                 {
-                    return true;
+                    AddColumnChange addColumnChange = (AddColumnChange)change;
+
+                    // Firebird does not apply default values or identity 
status to existing rows when adding a column
+                    return !addColumnChange.getNewColumn().isAutoIncrement() &&
+                           ((addColumnChange.getNewColumn().getDefaultValue() 
== null) && !addColumnChange.getNewColumn().isRequired());
                 }
                 else
                 {
-                    return super.isSupported(intermediateTable, change);
+                    return (change instanceof RemoveColumnChange) ||
+                           super.isSupported(intermediateTable, change);
                 }
             }
         };
@@ -200,14 +207,21 @@
         Table  changedTable = findChangedTable(currentModel, change);
         Column prevColumn   = null;
 
-        if (change.getPreviousColumn() != null)
+        if (change.getNextColumn() == null)
+        {
+            getSqlBuilder().addColumn(currentModel, changedTable, 
change.getNewColumn());
+        }
+        else
         {
-            prevColumn = changedTable.findColumn(change.getPreviousColumn(), 
isDelimitedIdentifierModeOn());
+            if (change.getPreviousColumn() != null)
+            {
+                prevColumn = 
changedTable.findColumn(change.getPreviousColumn(), 
isDelimitedIdentifierModeOn());
+            }
+            ((FirebirdBuilder)getSqlBuilder()).insertColumn(currentModel,
+                                                            changedTable,
+                                                            
change.getNewColumn(),
+                                                            prevColumn);
         }
-        ((FirebirdBuilder)getSqlBuilder()).insertColumn(currentModel,
-                                                        changedTable,
-                                                        change.getNewColumn(),
-                                                        prevColumn);
         change.apply(currentModel, isDelimitedIdentifierModeOn());
     }
 

Modified: 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/hsqldb/HsqlDbBuilder.java
URL: 
http://svn.apache.org/viewvc/db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/hsqldb/HsqlDbBuilder.java?rev=712002&r1=712001&r2=712002&view=diff
==============================================================================
--- 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/hsqldb/HsqlDbBuilder.java
 (original)
+++ 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/hsqldb/HsqlDbBuilder.java
 Thu Nov  6 14:53:59 2008
@@ -153,10 +153,12 @@
      */
     protected void writeCastExpression(Column sourceColumn, Column 
targetColumn) throws IOException
     {
-        if (ColumnDefinitionChange.isTypeChanged(getPlatformInfo(), 
sourceColumn, targetColumn) ||
-            ColumnDefinitionChange.isSizeChanged(getPlatformInfo(), 
sourceColumn, targetColumn))
+        boolean sizeChanged = 
ColumnDefinitionChange.isSizeChanged(getPlatformInfo(), sourceColumn, 
targetColumn);
+        boolean typeChanged = 
ColumnDefinitionChange.isTypeChanged(getPlatformInfo(), sourceColumn, 
targetColumn);
+
+        if (sizeChanged || typeChanged)
         {
-            boolean needSubstr = 
TypeMap.isTextType(targetColumn.getTypeCode()) && (targetColumn.getSize() != 
null);
+            boolean needSubstr = 
TypeMap.isTextType(targetColumn.getTypeCode()) && sizeChanged && 
(sourceColumn.getSizeAsInt() > targetColumn.getSizeAsInt());
 
             if (needSubstr)
             {
@@ -181,10 +183,9 @@
                 print(")");
             }
         }
-        else {
+        else
+        {
             super.writeCastExpression(sourceColumn, targetColumn);
         }
     }
-
-
 }

Modified: 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/mssql/MSSqlBuilder.java
URL: 
http://svn.apache.org/viewvc/db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/mssql/MSSqlBuilder.java?rev=712002&r1=712001&r2=712002&view=diff
==============================================================================
--- 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/mssql/MSSqlBuilder.java
 (original)
+++ 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/mssql/MSSqlBuilder.java
 Thu Nov  6 14:53:59 2008
@@ -529,8 +529,8 @@
 
         if (sizeChanged || typeChanged)
         {
-            if (TypeMap.isTextType(targetColumn.getTypeCode()) &&
-                sizeChanged && (sourceColumn.getSizeAsInt() > 
targetColumn.getSizeAsInt()))
+            if (TypeMap.isTextType(targetColumn.getTypeCode()) && sizeChanged 
&&
+                (targetColumn.getSize() != null) && 
(sourceColumn.getSizeAsInt() > targetColumn.getSizeAsInt()))
             {
                 print("SUBSTRING(CAST(");
                 printIdentifier(getColumnName(sourceColumn));

Modified: 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/postgresql/PostgreSqlBuilder.java
URL: 
http://svn.apache.org/viewvc/db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/postgresql/PostgreSqlBuilder.java?rev=712002&r1=712001&r2=712002&view=diff
==============================================================================
--- 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/postgresql/PostgreSqlBuilder.java
 (original)
+++ 
db/ddlutils/trunk/src/main/java/org/apache/ddlutils/platform/postgresql/PostgreSqlBuilder.java
 Thu Nov  6 14:53:59 2008
@@ -171,13 +171,13 @@
     /**
      * [EMAIL PROTECTED]
      */
-    public void addColumn(Table table, Column newColumn) throws IOException
+    public void addColumn(Database model, Table table, Column newColumn) 
throws IOException
     {
         if (newColumn.isAutoIncrement())
         {
             createAutoIncrementSequence(table, newColumn);
         }
-        super.addColumn(table, newColumn);
+        super.addColumn(model, table, newColumn);
     }
 
     /**

Modified: 
db/ddlutils/trunk/src/test/java/org/apache/ddlutils/io/TestAddColumn.java
URL: 
http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/java/org/apache/ddlutils/io/TestAddColumn.java?rev=712002&r1=712001&r2=712002&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/java/org/apache/ddlutils/io/TestAddColumn.java 
(original)
+++ db/ddlutils/trunk/src/test/java/org/apache/ddlutils/io/TestAddColumn.java 
Thu Nov  6 14:53:59 2008
@@ -26,7 +26,6 @@
 
 import org.apache.commons.beanutils.DynaBean;
 import org.apache.ddlutils.TestAgainstLiveDatabaseBase;
-import org.apache.ddlutils.platform.firebird.FirebirdPlatform;
 import org.apache.ddlutils.platform.interbase.InterbasePlatform;
 import org.apache.ddlutils.platform.mckoi.MckoiPlatform;
 import org.apache.ddlutils.platform.mysql.MySql50Platform;
@@ -1060,16 +1059,7 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            InterbasePlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals((Object)null,   beans.get(0), "avalue");
-        }
-        else
-        {
-            assertTrue(beans.isEmpty());
-        }
+        assertTrue(beans.isEmpty());
     }
 
     /**
@@ -1157,17 +1147,8 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            InterbasePlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals((Object)null,   beans.get(0), "avalue");
-        }
-        else
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals(new Integer(1), beans.get(0), "avalue");
-        }
+        assertEquals(new Integer(1), beans.get(0), "pk");
+        assertEquals(new Integer(1), beans.get(0), "avalue");
     }
 
     /**
@@ -1255,17 +1236,7 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            InterbasePlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals((Object)null,   beans.get(0), "avalue1");
-            assertEquals((Object)null,   beans.get(0), "avalue2");
-        }
-        else
-        {
-            assertTrue(beans.isEmpty());
-        }
+        assertTrue(beans.isEmpty());
     }
 
 
@@ -1399,15 +1370,7 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals((Object)null,   beans.get(0), "avalue");
-        }
-        else
-        {
-            assertTrue(beans.isEmpty());
-        }
+        assertTrue(beans.isEmpty());
     }
 
     /**
@@ -1496,14 +1459,7 @@
         List beans = getRows("roundtrip");
 
         assertEquals(new Integer(1), beans.get(0), "pk");
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals((Object)null, beans.get(0), "avalue");
-        }
-        else
-        {
-            assertEquals(new Integer(1), beans.get(0), "avalue");
-        }
+        assertEquals(new Integer(1), beans.get(0), "avalue");
     }
 
     /**
@@ -1593,16 +1549,7 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals((Object)null,   beans.get(0), "avalue1");
-            assertEquals((Object)null,   beans.get(0), "avalue2");
-        }
-        else
-        {
-            assertTrue(beans.isEmpty());
-        }
+        assertTrue(beans.isEmpty());
     }
 
     /**
@@ -1647,16 +1594,7 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals(new Integer(1), beans.get(0), "avalue1");
-            assertEquals((Object)null,   beans.get(0), "avalue2");
-        }
-        else
-        {
-            assertTrue(beans.isEmpty());
-        }
+        assertTrue(beans.isEmpty());
     }
 
     /**
@@ -1807,17 +1745,7 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            InterbasePlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals(new Integer(2), beans.get(0), "avalue1");
-            assertEquals((Object)null,   beans.get(0), "avalue2");
-        }
-        else
-        {
-            assertTrue(beans.isEmpty());
-        }
+        assertTrue(beans.isEmpty());
     }
 
     /**
@@ -1918,19 +1846,9 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            InterbasePlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals(new Integer(2), beans.get(0), "avalue1");
-            assertEquals((Object)null,   beans.get(0), "avalue2");
-        }
-        else
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals(new Integer(2), beans.get(0), "avalue1");
-            assertEquals(new Integer(1), beans.get(0), "avalue2");
-        }
+        assertEquals(new Integer(1), beans.get(0), "pk");
+        assertEquals(new Integer(2), beans.get(0), "avalue1");
+        assertEquals(new Integer(1), beans.get(0), "avalue2");
     }
 
     /**
@@ -2031,18 +1949,7 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            InterbasePlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals(new Integer(2), beans.get(0), "avalue1");
-            assertEquals((Object)null,   beans.get(0), "avalue2");
-            assertEquals((Object)null,   beans.get(0), "avalue3");
-        }
-        else
-        {
-            assertTrue(beans.isEmpty());
-        }
+        assertTrue(beans.isEmpty());
     }
 
     /**
@@ -2195,16 +2102,7 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1), beans.get(0), "pk");
-            assertEquals(new Integer(2), beans.get(0), "avalue1");
-            assertEquals((Object)null,   beans.get(0), "avalue2");
-        }
-        else
-        {
-            assertTrue(beans.isEmpty());
-        }
+        assertTrue(beans.isEmpty());
     }
 
     /**
@@ -2307,14 +2205,7 @@
 
         assertEquals(new Integer(1), beans.get(0), "pk");
         assertEquals(new Integer(2), beans.get(0), "avalue1");
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals((Object)null, beans.get(0), "avalue2");
-        }
-        else
-        {
-            assertEquals(new Integer(1), beans.get(0), "avalue2");
-        }
+        assertEquals(new Integer(1), beans.get(0), "avalue2");
     }
 
     /**
@@ -2417,17 +2308,7 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1),  beans.get(0), "pk");
-            assertEquals(new Integer(2),  beans.get(0), "avalue1");
-            assertEquals((Object)null,    beans.get(0), "avalue2");
-            assertEquals((Object)null,    beans.get(0), "avalue3");
-        }
-        else
-        {
-            assertTrue(beans.isEmpty());
-        }
+        assertTrue(beans.isEmpty());
     }
 
     /**
@@ -2478,17 +2359,7 @@
 
         List beans = getRows("roundtrip");
 
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(1),  beans.get(0), "pk");
-            assertEquals(new Integer(2),  beans.get(0), "avalue1");
-            assertEquals(new Integer(3),  beans.get(0), "avalue2");
-            assertEquals((Object)null,    beans.get(0), "avalue3");
-        }
-        else
-        {
-            assertTrue(beans.isEmpty());
-        }
+        assertTrue(beans.isEmpty());
     }
 
     /**
@@ -2645,17 +2516,7 @@
         List beans2 = getRows("roundtrip2");
 
         assertEquals(new BigDecimal(1), beans1.get(0), "pk");
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            InterbasePlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            MckoiPlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(2), beans2.get(0), "pk");
-            assertEquals((Object)null,   beans2.get(0), "avalue");
-        }
-        else
-        {
-            assertTrue(beans2.isEmpty());
-        }
+        assertTrue(beans2.isEmpty());
     }
 
     /**
@@ -2757,15 +2618,7 @@
 
         assertEquals(new Integer(1), beans1.get(0), "pk");
         assertEquals(new Integer(2), beans2.get(0), "pk");
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            InterbasePlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals((Object)null, beans2.get(0), "avalue");
-        }
-        else
-        {
-            assertEquals(new Integer(1), beans2.get(0), "avalue");
-        }
+        assertEquals(new Integer(1), beans2.get(0), "avalue");
     }
 
     /**
@@ -2873,23 +2726,7 @@
 
         assertEquals(new Integer(1), beans1.get(0), "pk1");
         assertEquals(new Double(2),  beans1.get(0), "pk2");
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            InterbasePlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(3), beans2.get(0), "pk");
-            assertEquals((Object)null,   beans2.get(0), "avalue1");
-            assertEquals((Object)null,   beans2.get(0), "avalue2");
-        }
-        else if (MckoiPlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals(new Integer(3), beans2.get(0), "pk");
-            assertEquals(new Integer(1), beans2.get(0), "avalue1");
-            assertEquals((Object)null,   beans2.get(0), "avalue2");
-        }
-        else
-        {
-            assertTrue(beans2.isEmpty());
-        }
+        assertTrue(beans2.isEmpty());
     }
 
     /**
@@ -3350,15 +3187,7 @@
         assertEquals(new Integer(1), beans1.get(0), "pk2");
         assertEquals(new Integer(2), beans2.get(0), "pk");
         assertEquals(new Integer(1), beans2.get(0), "avalue1");
-        if (FirebirdPlatform.DATABASENAME.equals(getPlatform().getName()) ||
-            InterbasePlatform.DATABASENAME.equals(getPlatform().getName()))
-        {
-            assertEquals((Object)null, beans2.get(0), "avalue2");
-        }
-        else
-        {
-            assertEquals(new Integer(1), beans2.get(0), "avalue2");
-        }
+        assertEquals(new Integer(1), beans2.get(0), "avalue2");
     }
 
     /**