db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r510850 - in /db/ddlutils/trunk/src: java/org/apache/ddlutils/PlatformFactory.java java/org/apache/ddlutils/platform/sybase/SybaseASE15Platform.java test/org/apache/ddlutils/io/TestAlteration.java test/org/apache/ddlutils/io/TestMisc.java
Date Fri, 23 Feb 2007 06:55:47 GMT
Author: tomdz
Date: Thu Feb 22 22:55:47 2007
New Revision: 510850

URL: http://svn.apache.org/viewvc?view=rev&rev=510850
Log:
Adjusted tests to be able to run against Sybase ASE
Added Sybase ASE 15 platform for making the tests run on both ASE 12.5 and ASE 15

Added:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/sybase/SybaseASE15Platform.java
Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformFactory.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestMisc.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformFactory.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformFactory.java?view=diff&rev=510850&r1=510849&r2=510850
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformFactory.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformFactory.java Thu Feb 22 22:55:47 2007
@@ -40,6 +40,7 @@
 import org.apache.ddlutils.platform.oracle.Oracle9Platform;
 import org.apache.ddlutils.platform.postgresql.PostgreSqlPlatform;
 import org.apache.ddlutils.platform.sapdb.SapDbPlatform;
+import org.apache.ddlutils.platform.sybase.SybaseASE15Platform;
 import org.apache.ddlutils.platform.sybase.SybasePlatform;
 
 /**
@@ -181,25 +182,26 @@
      */
     private static void registerPlatforms()
     {
-        addPlatform(_platforms, AxionPlatform.DATABASENAME,      AxionPlatform.class);
-        addPlatform(_platforms, CloudscapePlatform.DATABASENAME, CloudscapePlatform.class);
-        addPlatform(_platforms, Db2Platform.DATABASENAME,        Db2Platform.class);
-        addPlatform(_platforms, Db2v8Platform.DATABASENAME,      Db2v8Platform.class);
-        addPlatform(_platforms, DerbyPlatform.DATABASENAME,      DerbyPlatform.class);
-        addPlatform(_platforms, FirebirdPlatform.DATABASENAME,   FirebirdPlatform.class);
-        addPlatform(_platforms, HsqlDbPlatform.DATABASENAME,     HsqlDbPlatform.class);
-        addPlatform(_platforms, InterbasePlatform.DATABASENAME,  InterbasePlatform.class);
-        addPlatform(_platforms, MaxDbPlatform.DATABASENAME,      MaxDbPlatform.class);
-        addPlatform(_platforms, MckoiPlatform.DATABASENAME,      MckoiPlatform.class);
-        addPlatform(_platforms, MSSqlPlatform.DATABASENAME,      MSSqlPlatform.class);
-        addPlatform(_platforms, MySqlPlatform.DATABASENAME,      MySqlPlatform.class);
-        addPlatform(_platforms, MySql50Platform.DATABASENAME,    MySql50Platform.class);
-        addPlatform(_platforms, Oracle8Platform.DATABASENAME,    Oracle8Platform.class);
-        addPlatform(_platforms, Oracle9Platform.DATABASENAME,    Oracle9Platform.class);
-        addPlatform(_platforms, Oracle10Platform.DATABASENAME,   Oracle10Platform.class);
-        addPlatform(_platforms, PostgreSqlPlatform.DATABASENAME, PostgreSqlPlatform.class);
-        addPlatform(_platforms, SapDbPlatform.DATABASENAME,      SapDbPlatform.class);
-        addPlatform(_platforms, SybasePlatform.DATABASENAME,     SybasePlatform.class);
+        addPlatform(_platforms, AxionPlatform.DATABASENAME,       AxionPlatform.class);
+        addPlatform(_platforms, CloudscapePlatform.DATABASENAME,  CloudscapePlatform.class);
+        addPlatform(_platforms, Db2Platform.DATABASENAME,         Db2Platform.class);
+        addPlatform(_platforms, Db2v8Platform.DATABASENAME,       Db2v8Platform.class);
+        addPlatform(_platforms, DerbyPlatform.DATABASENAME,       DerbyPlatform.class);
+        addPlatform(_platforms, FirebirdPlatform.DATABASENAME,    FirebirdPlatform.class);
+        addPlatform(_platforms, HsqlDbPlatform.DATABASENAME,      HsqlDbPlatform.class);
+        addPlatform(_platforms, InterbasePlatform.DATABASENAME,   InterbasePlatform.class);
+        addPlatform(_platforms, MaxDbPlatform.DATABASENAME,       MaxDbPlatform.class);
+        addPlatform(_platforms, MckoiPlatform.DATABASENAME,       MckoiPlatform.class);
+        addPlatform(_platforms, MSSqlPlatform.DATABASENAME,       MSSqlPlatform.class);
+        addPlatform(_platforms, MySqlPlatform.DATABASENAME,       MySqlPlatform.class);
+        addPlatform(_platforms, MySql50Platform.DATABASENAME,     MySql50Platform.class);
+        addPlatform(_platforms, Oracle8Platform.DATABASENAME,     Oracle8Platform.class);
+        addPlatform(_platforms, Oracle9Platform.DATABASENAME,     Oracle9Platform.class);
+        addPlatform(_platforms, Oracle10Platform.DATABASENAME,    Oracle10Platform.class);
+        addPlatform(_platforms, PostgreSqlPlatform.DATABASENAME,  PostgreSqlPlatform.class);
+        addPlatform(_platforms, SapDbPlatform.DATABASENAME,       SapDbPlatform.class);
+        addPlatform(_platforms, SybasePlatform.DATABASENAME,      SybasePlatform.class);
+        addPlatform(_platforms, SybaseASE15Platform.DATABASENAME, SybaseASE15Platform.class);
     }
 
     /**

Added: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/sybase/SybaseASE15Platform.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/sybase/SybaseASE15Platform.java?view=auto&rev=510850
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/sybase/SybaseASE15Platform.java (added)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/sybase/SybaseASE15Platform.java Thu Feb 22 22:55:47 2007
@@ -0,0 +1,47 @@
+package org.apache.ddlutils.platform.sybase;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * The platform implementation for Sybase ASE 15 and above.
+ * 
+ * @version $Revision:  $
+ */
+public class SybaseASE15Platform extends SybasePlatform
+{
+    /** Database name of this platform. */
+    public static final String DATABASENAME     = "SybaseASE15";
+    
+    /**
+     * Creates a new platform instance.
+     */
+    public SybaseASE15Platform()
+    {
+        super();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getName()
+    {
+        return DATABASENAME;
+    }
+}

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java?view=diff&rev=510850&r1=510849&r2=510850
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAlteration.java Thu Feb 22 22:55:47 2007
@@ -625,9 +625,9 @@
             return;
         }
 
-        boolean isSybase = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
-        String  model1Xml; 
-        String  model2Xml;
+        boolean      isSybase = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
+        final String model1Xml; 
+        final String model2Xml;
 
         if (isSybase)
         {
@@ -731,15 +731,15 @@
     	}
 
         // we need special catering for Sybase which does not support identity for INTEGER columns
-        boolean isSybase  = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
-        String  model1Xml = 
+        boolean      isSybase  = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
+        final String model1Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database name='roundtriptest'>\n"+
             "  <table name='roundtrip'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "  </table>\n"+
             "</database>";
-        String model2Xml;
+        final String model2Xml;
 
         if (isSybase)
         {
@@ -1045,15 +1045,15 @@
             return;
         }
 
-        boolean isSybase = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
-        String model2Xml = 
+        boolean      isSybase  = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
+        final String model1Xml;
+        final String model2Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database name='roundtriptest'>\n"+
             "  <table name='roundtrip'>\n"+
             "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
             "  </table>\n"+
             "</database>";
-        String model1Xml; 
 
         if (isSybase)
         {
@@ -1964,19 +1964,37 @@
             "    <column name='pk' type='VARCHAR' size='20' primaryKey='true' required='true'/>\n"+
             "  </table>\n"+
            "</database>";
-        final String model2Xml = 
-            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
-            "<database name='roundtriptest'>\n"+
-            "  <table name='roundtrip1'>\n"+
-            "    <column name='pk' type='VARCHAR' size='20' primaryKey='true' required='true'/>\n"+
-            "  </table>\n"+
-            "  <table name='roundtrip2'>\n"+
-            "    <column name='pk' type='INTEGER' primaryKey='true' autoIncrement='true' required='true'/>\n"+
-            "  </table>\n"+
-           "</database>";
+        final String model2Xml; 
 
+        // Sybase does not like INTEGER auto-increment columns
+        if (SybasePlatform.DATABASENAME.equals(getPlatform().getName()))
+        {
+            model2Xml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='roundtrip1'>\n"+
+                "    <column name='pk' type='VARCHAR' size='20' primaryKey='true' required='true'/>\n"+
+                "  </table>\n"+
+                "  <table name='roundtrip2'>\n"+
+                "    <column name='pk' type='NUMERIC' size='12,0' primaryKey='true' autoIncrement='true' required='true'/>\n"+
+                "  </table>\n"+
+               "</database>";
+        }
+        else
+        {
+            model2Xml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='roundtrip1'>\n"+
+                "    <column name='pk' type='VARCHAR' size='20' primaryKey='true' required='true'/>\n"+
+                "  </table>\n"+
+                "  <table name='roundtrip2'>\n"+
+                "    <column name='pk' type='INTEGER' primaryKey='true' autoIncrement='true' required='true'/>\n"+
+                "  </table>\n"+
+               "</database>";
+        }
         createDatabase(model1Xml);
-
+        
         insertRow("roundtrip1", new Object[] { "1" });
 
         alterDatabase(model2Xml);
@@ -2077,18 +2095,35 @@
      */
     public void testRemoveTable3()
     {
-        final String model1Xml = 
-            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
-            "<database name='roundtriptest'>\n"+
-            "  <table name='roundtrip'>\n"+
-            "    <column name='pk' type='INTEGER' primaryKey='true' required='true' autoIncrement='true'/>\n"+
-            "    <column name='avalue' type='VARCHAR' size='20' required='true'/>\n"+
-            "  </table>\n"+
-            "</database>";
+        final String model1Xml;
         final String model2Xml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<database name='roundtriptest'>\n"+
             "</database>";
+
+        // Sybase does not like INTEGER auto-increment columns
+        if (SybasePlatform.DATABASENAME.equals(getPlatform().getName()))
+        {
+            model1Xml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='roundtrip'>\n"+
+                "    <column name='pk' type='NUMERIC' size='12,0' primaryKey='true' required='true' autoIncrement='true'/>\n"+
+                "    <column name='avalue' type='VARCHAR' size='20' required='true'/>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
+        else
+        {
+            model1Xml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='roundtrip'>\n"+
+                "    <column name='pk' type='NUMERIC' size='12,0' primaryKey='true' required='true' autoIncrement='true'/>\n"+
+                "    <column name='avalue' type='VARCHAR' size='20' required='true'/>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
 
         createDatabase(model1Xml);
 

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestMisc.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestMisc.java?view=diff&rev=510850&r1=510849&r2=510850
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestMisc.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestMisc.java Thu Feb 22 22:55:47 2007
@@ -22,6 +22,7 @@
 import java.io.Reader;
 import java.io.StringReader;
 import java.io.StringWriter;
+import java.math.BigDecimal;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
@@ -30,6 +31,7 @@
 
 import org.apache.commons.beanutils.DynaBean;
 import org.apache.ddlutils.platform.hsqldb.HsqlDbPlatform;
+import org.apache.ddlutils.platform.sybase.SybasePlatform;
 import org.dom4j.Document;
 import org.dom4j.Element;
 import org.dom4j.io.SAXReader;
@@ -63,31 +65,68 @@
             // TODO: for testing these platforms, we need deleteRows
             return;
         }
-        final String modelXml = 
-            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
-            "<database name='roundtriptest'>\n"+
-            "  <table name='misc1'>\n"+
-            "    <column name='pk' type='INTEGER' primaryKey='true' required='true' autoIncrement='true'/>\n"+
-            "    <column name='avalue' type='INTEGER' required='false'/>\n"+
-            "  </table>\n"+
-            "  <table name='misc2'>\n"+
-            "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
-            "    <column name='fk' type='INTEGER' required='false'/>\n"+
-            "    <foreign-key name='test' foreignTable='misc1'>\n"+
-            "      <reference local='fk' foreign='pk'/>\n"+
-            "    </foreign-key>\n"+
-            "  </table>\n"+
-            "</database>";
+
+        // Sybase does not like INTEGER auto-increment columns
+        boolean      isSybase = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
+        final String modelXml; 
+
+        if (isSybase)
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc1'>\n"+
+                "    <column name='pk' type='NUMERIC' size='12,0' primaryKey='true' required='true' autoIncrement='true'/>\n"+
+                "    <column name='avalue' type='INTEGER' required='false'/>\n"+
+                "  </table>\n"+
+                "  <table name='misc2'>\n"+
+                "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
+                "    <column name='fk' type='NUMERIC' size='12,0' required='false'/>\n"+
+                "    <foreign-key name='test' foreignTable='misc1'>\n"+
+                "      <reference local='fk' foreign='pk'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
+        else
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc1'>\n"+
+                "    <column name='pk' type='INTEGER' primaryKey='true' required='true' autoIncrement='true'/>\n"+
+                "    <column name='avalue' type='INTEGER' required='false'/>\n"+
+                "  </table>\n"+
+                "  <table name='misc2'>\n"+
+                "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
+                "    <column name='fk' type='INTEGER' required='false'/>\n"+
+                "    <foreign-key name='test' foreignTable='misc1'>\n"+
+                "      <reference local='fk' foreign='pk'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
 
         createDatabase(modelXml);
 
         getPlatform().setIdentityOverrideOn(true);
 
-        insertRow("misc1", new Object[] { new Integer(10), new Integer(1) });
-        insertRow("misc1", new Object[] { new Integer(12), new Integer(2) });
-        insertRow("misc1", new Object[] { new Integer(13), new Integer(3) });
-        insertRow("misc2", new Object[] { new Integer(1), new Integer(10) });
-        insertRow("misc2", new Object[] { new Integer(2), new Integer(13) });
+        if (isSybase)
+        {
+            insertRow("misc1", new Object[] { new BigDecimal(10), new Integer(1) });
+            insertRow("misc1", new Object[] { new BigDecimal(12), new Integer(2) });
+            insertRow("misc1", new Object[] { new BigDecimal(13), new Integer(3) });
+            insertRow("misc2", new Object[] { new Integer(1), new BigDecimal(10) });
+            insertRow("misc2", new Object[] { new Integer(2), new BigDecimal(13) });
+        }
+        else
+        {
+            insertRow("misc1", new Object[] { new Integer(10), new Integer(1) });
+            insertRow("misc1", new Object[] { new Integer(12), new Integer(2) });
+            insertRow("misc1", new Object[] { new Integer(13), new Integer(3) });
+            insertRow("misc2", new Object[] { new Integer(1), new Integer(10) });
+            insertRow("misc2", new Object[] { new Integer(2), new Integer(13) });
+        }
 
         StringWriter   stringWriter = new StringWriter();
         DatabaseDataIO dataIO       = new DatabaseDataIO();
@@ -135,19 +174,36 @@
 
         List beans = getRows("misc1");
 
-        assertEquals(new Integer(10), beans.get(0), "pk");
+        if (isSybase)
+        {
+            assertEquals(new BigDecimal(10), beans.get(0), "pk");
+            assertEquals(new BigDecimal(12), beans.get(1), "pk");
+            assertEquals(new BigDecimal(13), beans.get(2), "pk");
+        }
+        else
+        {
+            assertEquals(new Integer(10), beans.get(0), "pk");
+            assertEquals(new Integer(12), beans.get(1), "pk");
+            assertEquals(new Integer(13), beans.get(2), "pk");
+        }
         assertEquals(new Integer(1),  beans.get(0), "avalue");
-        assertEquals(new Integer(12), beans.get(1), "pk");
         assertEquals(new Integer(2),  beans.get(1), "avalue");
-        assertEquals(new Integer(13), beans.get(2), "pk");
         assertEquals(new Integer(3),  beans.get(2), "avalue");
 
         beans = getRows("misc2");
 
         assertEquals(new Integer(1),  beans.get(0), "pk");
-        assertEquals(new Integer(10), beans.get(0), "fk");
         assertEquals(new Integer(2),  beans.get(1), "pk");
-        assertEquals(new Integer(13), beans.get(1), "fk");
+        if (isSybase)
+        {
+            assertEquals(new BigDecimal(10), beans.get(0), "fk");
+            assertEquals(new BigDecimal(13), beans.get(1), "fk");
+        }
+        else
+        {
+            assertEquals(new Integer(10), beans.get(0), "fk");
+            assertEquals(new Integer(13), beans.get(1), "fk");
+        }
     }
 
     /**
@@ -162,31 +218,67 @@
             return;
         }
 
-        final String modelXml = 
-            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
-            "<database name='roundtriptest'>\n"+
-            "  <table name='misc1'>\n"+
-            "    <column name='pk' type='INTEGER' primaryKey='true' required='true' autoIncrement='true'/>\n"+
-            "    <column name='avalue' type='INTEGER' required='false'/>\n"+
-            "  </table>\n"+
-            "  <table name='misc2'>\n"+
-            "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
-            "    <column name='fk' type='INTEGER' required='false'/>\n"+
-            "    <foreign-key name='test' foreignTable='misc1'>\n"+
-            "      <reference local='fk' foreign='pk'/>\n"+
-            "    </foreign-key>\n"+
-            "  </table>\n"+
-            "</database>";
+        // Sybase does not like INTEGER auto-increment columns
+        boolean      isSybase = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
+        final String modelXml; 
+
+        if (isSybase)
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc1'>\n"+
+                "    <column name='pk' type='NUMERIC' size='12,0' primaryKey='true' required='true' autoIncrement='true'/>\n"+
+                "    <column name='avalue' type='INTEGER' required='false'/>\n"+
+                "  </table>\n"+
+                "  <table name='misc2'>\n"+
+                "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
+                "    <column name='fk' type='NUMERIC' size='12,0' required='false'/>\n"+
+                "    <foreign-key name='test' foreignTable='misc1'>\n"+
+                "      <reference local='fk' foreign='pk'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
+        else
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc1'>\n"+
+                "    <column name='pk' type='INTEGER' primaryKey='true' required='true' autoIncrement='true'/>\n"+
+                "    <column name='avalue' type='INTEGER' required='false'/>\n"+
+                "  </table>\n"+
+                "  <table name='misc2'>\n"+
+                "    <column name='pk' type='INTEGER' primaryKey='true' required='true'/>\n"+
+                "    <column name='fk' type='INTEGER' required='false'/>\n"+
+                "    <foreign-key name='test' foreignTable='misc1'>\n"+
+                "      <reference local='fk' foreign='pk'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
 
         createDatabase(modelXml);
 
         getPlatform().setIdentityOverrideOn(true);
 
-        insertRow("misc1", new Object[] { new Integer(10), new Integer(1) });
-        insertRow("misc1", new Object[] { new Integer(12), new Integer(2) });
-        insertRow("misc1", new Object[] { new Integer(13), new Integer(3) });
-        insertRow("misc2", new Object[] { new Integer(1), new Integer(10) });
-        insertRow("misc2", new Object[] { new Integer(2), new Integer(13) });
+        if (isSybase)
+        {
+            insertRow("misc1", new Object[] { new BigDecimal(10), new Integer(1) });
+            insertRow("misc1", new Object[] { new BigDecimal(12), new Integer(2) });
+            insertRow("misc1", new Object[] { new BigDecimal(13), new Integer(3) });
+            insertRow("misc2", new Object[] { new Integer(1), new BigDecimal(10) });
+            insertRow("misc2", new Object[] { new Integer(2), new BigDecimal(13) });
+        }
+        else
+        {
+            insertRow("misc1", new Object[] { new Integer(10), new Integer(1) });
+            insertRow("misc1", new Object[] { new Integer(12), new Integer(2) });
+            insertRow("misc1", new Object[] { new Integer(13), new Integer(3) });
+            insertRow("misc2", new Object[] { new Integer(1), new Integer(10) });
+            insertRow("misc2", new Object[] { new Integer(2), new Integer(13) });
+        }
 
         StringWriter   stringWriter = new StringWriter();
         DatabaseDataIO dataIO       = new DatabaseDataIO();
@@ -236,19 +328,36 @@
 
         List beans = getRows("misc1");
 
-        assertEquals(new Integer(1), beans.get(0), "pk");
+        if (isSybase)
+        {
+            assertEquals(new BigDecimal(1), beans.get(0), "pk");
+            assertEquals(new BigDecimal(2), beans.get(1), "pk");
+            assertEquals(new BigDecimal(3), beans.get(2), "pk");
+        }
+        else
+        {
+            assertEquals(new Integer(1), beans.get(0), "pk");
+            assertEquals(new Integer(2), beans.get(1), "pk");
+            assertEquals(new Integer(3), beans.get(2), "pk");
+        }
         assertEquals(new Integer(1), beans.get(0), "avalue");
-        assertEquals(new Integer(2), beans.get(1), "pk");
         assertEquals(new Integer(2), beans.get(1), "avalue");
-        assertEquals(new Integer(3), beans.get(2), "pk");
         assertEquals(new Integer(3), beans.get(2), "avalue");
 
         beans = getRows("misc2");
 
         assertEquals(new Integer(1), beans.get(0), "pk");
-        assertEquals(new Integer(1), beans.get(0), "fk");
         assertEquals(new Integer(2), beans.get(1), "pk");
-        assertEquals(new Integer(3), beans.get(1), "fk");
+        if (isSybase)
+        {
+            assertEquals(new BigDecimal(1), beans.get(0), "fk");
+            assertEquals(new BigDecimal(3), beans.get(1), "fk");
+        }
+        else
+        {
+            assertEquals(new Integer(1), beans.get(0), "fk");
+            assertEquals(new Integer(3), beans.get(1), "fk");
+        }
     }
 
     /**
@@ -263,26 +372,57 @@
             return;
         }
 
-        final String modelXml = 
-            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
-            "<database name='roundtriptest'>\n"+
-            "  <table name='misc'>\n"+
-            "    <column name='pk' type='INTEGER' primaryKey='true' required='true' autoIncrement='true'/>\n"+
-            "    <column name='fk' type='INTEGER' required='false'/>\n"+
-            "    <foreign-key name='test' foreignTable='misc'>\n"+
-            "      <reference local='fk' foreign='pk'/>\n"+
-            "    </foreign-key>\n"+
-            "  </table>\n"+
-            "</database>";
+        // Sybase does not like INTEGER auto-increment columns
+        boolean      isSybase = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
+        final String modelXml;
+
+        if (isSybase)
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc'>\n"+
+                "    <column name='pk' type='NUMERIC' size='12,0' primaryKey='true' required='true' autoIncrement='true'/>\n"+
+                "    <column name='fk' type='NUMERIC' size='12,0' required='false'/>\n"+
+                "    <foreign-key name='test' foreignTable='misc'>\n"+
+                "      <reference local='fk' foreign='pk'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
+        else
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc'>\n"+
+                "    <column name='pk' type='INTEGER' primaryKey='true' required='true' autoIncrement='true'/>\n"+
+                "    <column name='fk' type='INTEGER' required='false'/>\n"+
+                "    <foreign-key name='test' foreignTable='misc'>\n"+
+                "      <reference local='fk' foreign='pk'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
 
         createDatabase(modelXml);
 
         getPlatform().setIdentityOverrideOn(false);
 
-        insertRow("misc", new Object[] { new Integer(1), null });
-        insertRow("misc", new Object[] { new Integer(2), new Integer(1) });
-        insertRow("misc", new Object[] { new Integer(3), new Integer(2) });
-        insertRow("misc", new Object[] { new Integer(4), new Integer(4) });
+        if (isSybase)
+        {
+            insertRow("misc", new Object[] { new BigDecimal(1), null });
+            insertRow("misc", new Object[] { new BigDecimal(2), new BigDecimal(1) });
+            insertRow("misc", new Object[] { new BigDecimal(3), new BigDecimal(2) });
+            insertRow("misc", new Object[] { new BigDecimal(4), new BigDecimal(4) });
+        }
+        else
+        {
+            insertRow("misc", new Object[] { new Integer(1), null });
+            insertRow("misc", new Object[] { new Integer(2), new Integer(1) });
+            insertRow("misc", new Object[] { new Integer(3), new Integer(2) });
+            insertRow("misc", new Object[] { new Integer(4), new Integer(4) });
+        }
 
         StringWriter   stringWriter = new StringWriter();
         DatabaseDataIO dataIO       = new DatabaseDataIO();
@@ -323,14 +463,28 @@
 
         List beans = getRows("misc");
 
-        assertEquals(new Integer(1), beans.get(0), "pk");
-        assertNull(((DynaBean)beans.get(0)).get("fk"));
-        assertEquals(new Integer(2), beans.get(1), "pk");
-        assertEquals(new Integer(1), beans.get(1), "fk");
-        assertEquals(new Integer(3), beans.get(2), "pk");
-        assertEquals(new Integer(2), beans.get(2), "fk");
-        assertEquals(new Integer(4), beans.get(3), "pk");
-        assertEquals(new Integer(4), beans.get(3), "fk");
+        if (isSybase)
+        {
+            assertEquals(new BigDecimal(1), beans.get(0), "pk");
+            assertNull(((DynaBean)beans.get(0)).get("fk"));
+            assertEquals(new BigDecimal(2), beans.get(1), "pk");
+            assertEquals(new BigDecimal(1), beans.get(1), "fk");
+            assertEquals(new BigDecimal(3), beans.get(2), "pk");
+            assertEquals(new BigDecimal(2), beans.get(2), "fk");
+            assertEquals(new BigDecimal(4), beans.get(3), "pk");
+            assertEquals(new BigDecimal(4), beans.get(3), "fk");
+        }
+        else
+        {
+            assertEquals(new Integer(1), beans.get(0), "pk");
+            assertNull(((DynaBean)beans.get(0)).get("fk"));
+            assertEquals(new Integer(2), beans.get(1), "pk");
+            assertEquals(new Integer(1), beans.get(1), "fk");
+            assertEquals(new Integer(3), beans.get(2), "pk");
+            assertEquals(new Integer(2), beans.get(2), "fk");
+            assertEquals(new Integer(4), beans.get(3), "pk");
+            assertEquals(new Integer(4), beans.get(3), "fk");
+        }
     }
 
     /**
@@ -345,26 +499,57 @@
             return;
         }
 
-        final String modelXml = 
-            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
-            "<database name='roundtriptest'>\n"+
-            "  <table name='misc'>\n"+
-            "    <column name='pk' type='INTEGER' primaryKey='true' required='true' autoIncrement='true'/>\n"+
-            "    <column name='fk' type='INTEGER' required='false'/>\n"+
-            "    <foreign-key name='test' foreignTable='misc'>\n"+
-            "      <reference local='fk' foreign='pk'/>\n"+
-            "    </foreign-key>\n"+
-            "  </table>\n"+
-            "</database>";
+        // Sybase does not like INTEGER auto-increment columns
+        boolean      isSybase = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
+        final String modelXml;
+
+        if (isSybase)
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc'>\n"+
+                "    <column name='pk' type='NUMERIC' size='12,0' primaryKey='true' required='true' autoIncrement='true'/>\n"+
+                "    <column name='fk' type='NUMERIC' size='12,0' required='false'/>\n"+
+                "    <foreign-key name='test' foreignTable='misc'>\n"+
+                "      <reference local='fk' foreign='pk'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
+        else
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc'>\n"+
+                "    <column name='pk' type='INTEGER' primaryKey='true' required='true' autoIncrement='true'/>\n"+
+                "    <column name='fk' type='INTEGER' required='false'/>\n"+
+                "    <foreign-key name='test' foreignTable='misc'>\n"+
+                "      <reference local='fk' foreign='pk'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
 
         createDatabase(modelXml);
 
         getPlatform().setIdentityOverrideOn(true);
 
-        insertRow("misc", new Object[] { new Integer(10), null });
-        insertRow("misc", new Object[] { new Integer(11), new Integer(10) });
-        insertRow("misc", new Object[] { new Integer(12), new Integer(11) });
-        insertRow("misc", new Object[] { new Integer(13), new Integer(13) });
+        if (isSybase)
+        {
+            insertRow("misc", new Object[] { new BigDecimal(10), null });
+            insertRow("misc", new Object[] { new BigDecimal(11), new BigDecimal(10) });
+            insertRow("misc", new Object[] { new BigDecimal(12), new BigDecimal(11) });
+            insertRow("misc", new Object[] { new BigDecimal(13), new BigDecimal(13) });
+        }
+        else
+        {
+            insertRow("misc", new Object[] { new Integer(10), null });
+            insertRow("misc", new Object[] { new Integer(11), new Integer(10) });
+            insertRow("misc", new Object[] { new Integer(12), new Integer(11) });
+            insertRow("misc", new Object[] { new Integer(13), new Integer(13) });
+        }
 
         StringWriter   stringWriter = new StringWriter();
         DatabaseDataIO dataIO       = new DatabaseDataIO();
@@ -405,14 +590,28 @@
 
         List beans = getRows("misc");
 
-        assertEquals(new Integer(10), beans.get(0), "pk");
-        assertNull(((DynaBean)beans.get(0)).get("fk"));
-        assertEquals(new Integer(11), beans.get(1), "pk");
-        assertEquals(new Integer(10), beans.get(1), "fk");
-        assertEquals(new Integer(12), beans.get(2), "pk");
-        assertEquals(new Integer(11), beans.get(2), "fk");
-        assertEquals(new Integer(13), beans.get(3), "pk");
-        assertEquals(new Integer(13), beans.get(3), "fk");
+        if (isSybase)
+        {
+            assertEquals(new BigDecimal(10), beans.get(0), "pk");
+            assertNull(((DynaBean)beans.get(0)).get("fk"));
+            assertEquals(new BigDecimal(11), beans.get(1), "pk");
+            assertEquals(new BigDecimal(10), beans.get(1), "fk");
+            assertEquals(new BigDecimal(12), beans.get(2), "pk");
+            assertEquals(new BigDecimal(11), beans.get(2), "fk");
+            assertEquals(new BigDecimal(13), beans.get(3), "pk");
+            assertEquals(new BigDecimal(13), beans.get(3), "fk");
+        }
+        else
+        {
+            assertEquals(new Integer(10), beans.get(0), "pk");
+            assertNull(((DynaBean)beans.get(0)).get("fk"));
+            assertEquals(new Integer(11), beans.get(1), "pk");
+            assertEquals(new Integer(10), beans.get(1), "fk");
+            assertEquals(new Integer(12), beans.get(2), "pk");
+            assertEquals(new Integer(11), beans.get(2), "fk");
+            assertEquals(new Integer(13), beans.get(3), "pk");
+            assertEquals(new Integer(13), beans.get(3), "fk");
+        }
     }
 
     /**
@@ -426,17 +625,39 @@
             return;
         }
 
-        final String modelXml = 
-            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
-            "<database name='roundtriptest'>\n"+
-            "  <table name='misc'>\n"+
-            "    <column name='id' primaryKey='true' required='true' type='SMALLINT' size='2' autoIncrement='true'/>\n"+
-            "    <column name='parent_id' primaryKey='false' required='false' type='SMALLINT' size='2' autoIncrement='false'/>\n"+
-            "    <foreign-key foreignTable='misc' name='misc_parent_fk'>\n"+
-            "      <reference local='parent_id' foreign='id'/>\n"+
-            "    </foreign-key>\n"+
-            "  </table>\n"+
-            "</database>";
+        // Sybase does not like INTEGER auto-increment columns
+        boolean      isSybase = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
+        final String modelXml;
+
+        if (isSybase)
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc'>\n"+
+                "    <column name='id' primaryKey='true' required='true' type='NUMERIC' size='10,0' autoIncrement='true'/>\n"+
+                "    <column name='parent_id' primaryKey='false' required='false' type='NUMERIC' size='10,0' autoIncrement='false'/>\n"+
+                "    <foreign-key foreignTable='misc' name='misc_parent_fk'>\n"+
+                "      <reference local='parent_id' foreign='id'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
+        else
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc'>\n"+
+                "    <column name='id' primaryKey='true' required='true' type='SMALLINT' size='2' autoIncrement='true'/>\n"+
+                "    <column name='parent_id' primaryKey='false' required='false' type='SMALLINT' size='2' autoIncrement='false'/>\n"+
+                "    <foreign-key foreignTable='misc' name='misc_parent_fk'>\n"+
+                "      <reference local='parent_id' foreign='id'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
+
         final String dataXml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<data>\n"+
@@ -465,31 +686,62 @@
 
         List beans = getRows("misc", "id");
 
-        assertEquals(12, beans.size());
-        assertEquals(new Integer(1),  beans.get(0), "id");
-        assertNull(((DynaBean)beans.get(0)).get("parent_id"));
-        assertEquals(new Integer(2),  beans.get(1), "id");
-        assertNull(((DynaBean)beans.get(1)).get("parent_id"));
-        assertEquals(new Integer(3),  beans.get(2), "id");
-        assertEquals(new Integer(2),  beans.get(2), "parent_id");
-        assertEquals(new Integer(4),  beans.get(3), "id");
-        assertEquals(new Integer(1),  beans.get(3), "parent_id");
-        assertEquals(new Integer(5),  beans.get(4), "id");
-        assertEquals(new Integer(3),  beans.get(4), "parent_id");
-        assertEquals(new Integer(6),  beans.get(5), "id");
-        assertNull(((DynaBean)beans.get(5)).get("parent_id"));
-        assertEquals(new Integer(7),  beans.get(6), "id");
-        assertEquals(new Integer(1),  beans.get(6), "parent_id");
-        assertEquals(new Integer(8),  beans.get(7), "id");
-        assertEquals(new Integer(7),  beans.get(7), "parent_id");
-        assertEquals(new Integer(9),  beans.get(8), "id");
-        assertEquals(new Integer(6),  beans.get(8), "parent_id");
-        assertEquals(new Integer(10), beans.get(9), "id");
-        assertEquals(new Integer(4),  beans.get(9), "parent_id");
-        assertEquals(new Integer(11), beans.get(10), "id");
-        assertNull(((DynaBean)beans.get(10)).get("parent_id"));
-        assertEquals(new Integer(12), beans.get(11), "id");
-        assertEquals(new Integer(11), beans.get(11), "parent_id");
+        if (isSybase)
+        {
+            assertEquals(12, beans.size());
+            assertEquals(new BigDecimal(1),  beans.get(0), "id");
+            assertNull(((DynaBean)beans.get(0)).get("parent_id"));
+            assertEquals(new BigDecimal(2),  beans.get(1), "id");
+            assertNull(((DynaBean)beans.get(1)).get("parent_id"));
+            assertEquals(new BigDecimal(3),  beans.get(2), "id");
+            assertEquals(new BigDecimal(2),  beans.get(2), "parent_id");
+            assertEquals(new BigDecimal(4),  beans.get(3), "id");
+            assertEquals(new BigDecimal(1),  beans.get(3), "parent_id");
+            assertEquals(new BigDecimal(5),  beans.get(4), "id");
+            assertEquals(new BigDecimal(3),  beans.get(4), "parent_id");
+            assertEquals(new BigDecimal(6),  beans.get(5), "id");
+            assertNull(((DynaBean)beans.get(5)).get("parent_id"));
+            assertEquals(new BigDecimal(7),  beans.get(6), "id");
+            assertEquals(new BigDecimal(1),  beans.get(6), "parent_id");
+            assertEquals(new BigDecimal(8),  beans.get(7), "id");
+            assertEquals(new BigDecimal(7),  beans.get(7), "parent_id");
+            assertEquals(new BigDecimal(9),  beans.get(8), "id");
+            assertEquals(new BigDecimal(6),  beans.get(8), "parent_id");
+            assertEquals(new BigDecimal(10), beans.get(9), "id");
+            assertEquals(new BigDecimal(4),  beans.get(9), "parent_id");
+            assertEquals(new BigDecimal(11), beans.get(10), "id");
+            assertNull(((DynaBean)beans.get(10)).get("parent_id"));
+            assertEquals(new BigDecimal(12), beans.get(11), "id");
+            assertEquals(new BigDecimal(11), beans.get(11), "parent_id");
+        }
+        else
+        {
+            assertEquals(12, beans.size());
+            assertEquals(new Integer(1),  beans.get(0), "id");
+            assertNull(((DynaBean)beans.get(0)).get("parent_id"));
+            assertEquals(new Integer(2),  beans.get(1), "id");
+            assertNull(((DynaBean)beans.get(1)).get("parent_id"));
+            assertEquals(new Integer(3),  beans.get(2), "id");
+            assertEquals(new Integer(2),  beans.get(2), "parent_id");
+            assertEquals(new Integer(4),  beans.get(3), "id");
+            assertEquals(new Integer(1),  beans.get(3), "parent_id");
+            assertEquals(new Integer(5),  beans.get(4), "id");
+            assertEquals(new Integer(3),  beans.get(4), "parent_id");
+            assertEquals(new Integer(6),  beans.get(5), "id");
+            assertNull(((DynaBean)beans.get(5)).get("parent_id"));
+            assertEquals(new Integer(7),  beans.get(6), "id");
+            assertEquals(new Integer(1),  beans.get(6), "parent_id");
+            assertEquals(new Integer(8),  beans.get(7), "id");
+            assertEquals(new Integer(7),  beans.get(7), "parent_id");
+            assertEquals(new Integer(9),  beans.get(8), "id");
+            assertEquals(new Integer(6),  beans.get(8), "parent_id");
+            assertEquals(new Integer(10), beans.get(9), "id");
+            assertEquals(new Integer(4),  beans.get(9), "parent_id");
+            assertEquals(new Integer(11), beans.get(10), "id");
+            assertNull(((DynaBean)beans.get(10)).get("parent_id"));
+            assertEquals(new Integer(12), beans.get(11), "id");
+            assertEquals(new Integer(11), beans.get(11), "parent_id");
+        }
     }
 
     /**
@@ -504,21 +756,47 @@
             return;
         }
 
-        final String modelXml = 
-            "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
-            "<database name='roundtriptest'>\n"+
-            "  <table name='misc'>\n"+
-            "    <column name='id' primaryKey='true' required='true' type='SMALLINT' size='2' autoIncrement='true'/>\n"+
-            "    <column name='left_id' primaryKey='false' required='false' type='SMALLINT' size='2' autoIncrement='false'/>\n"+
-            "    <column name='right_id' primaryKey='false' required='false' type='SMALLINT' size='2' autoIncrement='false'/>\n"+
-            "    <foreign-key foreignTable='misc' name='misc_left_fk'>\n"+
-            "      <reference local='left_id' foreign='id'/>\n"+
-            "    </foreign-key>\n"+
-            "    <foreign-key foreignTable='misc' name='misc_right_fk'>\n"+
-            "      <reference local='right_id' foreign='id'/>\n"+
-            "    </foreign-key>\n"+
-            "  </table>\n"+
-            "</database>";
+        // Sybase does not like INTEGER auto-increment columns
+        boolean      isSybase = SybasePlatform.DATABASENAME.equals(getPlatform().getName());
+        final String modelXml;
+
+        if (isSybase)
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc'>\n"+
+                "    <column name='id' primaryKey='true' required='true' type='NUMERIC' size='6,0' autoIncrement='true'/>\n"+
+                "    <column name='left_id' primaryKey='false' required='false' type='NUMERIC' size='6,0' autoIncrement='false'/>\n"+
+                "    <column name='right_id' primaryKey='false' required='false' type='NUMERIC' size='6,0' autoIncrement='false'/>\n"+
+                "    <foreign-key foreignTable='misc' name='misc_left_fk'>\n"+
+                "      <reference local='left_id' foreign='id'/>\n"+
+                "    </foreign-key>\n"+
+                "    <foreign-key foreignTable='misc' name='misc_right_fk'>\n"+
+                "      <reference local='right_id' foreign='id'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
+        else
+        {
+            modelXml = 
+                "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
+                "<database name='roundtriptest'>\n"+
+                "  <table name='misc'>\n"+
+                "    <column name='id' primaryKey='true' required='true' type='SMALLINT' size='2' autoIncrement='true'/>\n"+
+                "    <column name='left_id' primaryKey='false' required='false' type='SMALLINT' size='2' autoIncrement='false'/>\n"+
+                "    <column name='right_id' primaryKey='false' required='false' type='SMALLINT' size='2' autoIncrement='false'/>\n"+
+                "    <foreign-key foreignTable='misc' name='misc_left_fk'>\n"+
+                "      <reference local='left_id' foreign='id'/>\n"+
+                "    </foreign-key>\n"+
+                "    <foreign-key foreignTable='misc' name='misc_right_fk'>\n"+
+                "      <reference local='right_id' foreign='id'/>\n"+
+                "    </foreign-key>\n"+
+                "  </table>\n"+
+                "</database>";
+        }
+
         final String dataXml = 
             "<?xml version='1.0' encoding='ISO-8859-1'?>\n"+
             "<data>\n"+
@@ -542,24 +820,48 @@
         List beans = getRows("misc", "id");
 
         assertEquals(6, beans.size());
-        assertEquals(new Integer(1), beans.get(0), "id");
-        assertEquals(new Integer(2), beans.get(0), "left_id");
-        assertEquals(new Integer(3), beans.get(0), "right_id");
-        assertEquals(new Integer(2), beans.get(1), "id");
-        assertEquals(new Integer(5), beans.get(1), "left_id");
-        assertEquals(new Integer(4), beans.get(1), "right_id");
-        assertEquals(new Integer(3), beans.get(2), "id");
-        assertEquals(new Integer(2), beans.get(2), "left_id");
-        assertEquals(new Integer(4), beans.get(2), "right_id");
-        assertEquals(new Integer(4), beans.get(3), "id");
-        assertEquals(new Integer(6), beans.get(3), "left_id");
-        assertEquals((Object)null,   beans.get(3), "right_id");
-        assertEquals(new Integer(5), beans.get(4), "id");
-        assertEquals((Object)null,   beans.get(4), "left_id");
-        assertEquals(new Integer(6), beans.get(4), "right_id");
-        assertEquals(new Integer(6), beans.get(5), "id");
-        assertEquals((Object)null,   beans.get(5), "left_id");
-        assertEquals((Object)null,   beans.get(5), "right_id");
+        if (isSybase)
+        {
+            assertEquals(new BigDecimal(1), beans.get(0), "id");
+            assertEquals(new BigDecimal(2), beans.get(0), "left_id");
+            assertEquals(new BigDecimal(3), beans.get(0), "right_id");
+            assertEquals(new BigDecimal(2), beans.get(1), "id");
+            assertEquals(new BigDecimal(5), beans.get(1), "left_id");
+            assertEquals(new BigDecimal(4), beans.get(1), "right_id");
+            assertEquals(new BigDecimal(3), beans.get(2), "id");
+            assertEquals(new BigDecimal(2), beans.get(2), "left_id");
+            assertEquals(new BigDecimal(4), beans.get(2), "right_id");
+            assertEquals(new BigDecimal(4), beans.get(3), "id");
+            assertEquals(new BigDecimal(6), beans.get(3), "left_id");
+            assertEquals((Object)null,      beans.get(3), "right_id");
+            assertEquals(new BigDecimal(5), beans.get(4), "id");
+            assertEquals((Object)null,      beans.get(4), "left_id");
+            assertEquals(new BigDecimal(6), beans.get(4), "right_id");
+            assertEquals(new BigDecimal(6), beans.get(5), "id");
+            assertEquals((Object)null,      beans.get(5), "left_id");
+            assertEquals((Object)null,      beans.get(5), "right_id");
+        }
+        else
+        {
+            assertEquals(new Integer(1), beans.get(0), "id");
+            assertEquals(new Integer(2), beans.get(0), "left_id");
+            assertEquals(new Integer(3), beans.get(0), "right_id");
+            assertEquals(new Integer(2), beans.get(1), "id");
+            assertEquals(new Integer(5), beans.get(1), "left_id");
+            assertEquals(new Integer(4), beans.get(1), "right_id");
+            assertEquals(new Integer(3), beans.get(2), "id");
+            assertEquals(new Integer(2), beans.get(2), "left_id");
+            assertEquals(new Integer(4), beans.get(2), "right_id");
+            assertEquals(new Integer(4), beans.get(3), "id");
+            assertEquals(new Integer(6), beans.get(3), "left_id");
+            assertEquals((Object)null,   beans.get(3), "right_id");
+            assertEquals(new Integer(5), beans.get(4), "id");
+            assertEquals((Object)null,   beans.get(4), "left_id");
+            assertEquals(new Integer(6), beans.get(4), "right_id");
+            assertEquals(new Integer(6), beans.get(5), "id");
+            assertEquals((Object)null,   beans.get(5), "left_id");
+            assertEquals((Object)null,   beans.get(5), "right_id");
+        }
     }
 
     /**



Mime
View raw message