db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r355281 - in /db/ddlutils/trunk/src: doc/src/documentation/content/xdocs/ java/org/apache/ddlutils/platform/ test/org/apache/ddlutils/io/ test/org/apache/ddlutils/platform/
Date Thu, 08 Dec 2005 23:40:08 GMT
Author: mvdb
Date: Thu Dec  8 15:39:57 2005
New Revision: 355281

URL: http://svn.apache.org/viewcvs?rev=355281&view=rev
Log:
Improve axion support.
- It doesn't support BIGINT yet, so using LONG instead. (in axion cvs BIGINT is supported).
Also reflected this in the docs
- Axion doesn't seem to be able to use quotes around fields and tables.
- When comments are on, axion chokes, so by default it is turned of now
- Updated the TestAxionPlatform to reflect the changes in quoting




Modified:
    db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/database-support.xml
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/AxionBuilder.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/AxionPlatform.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAgainstAxionDb.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestAxionPlatform.java

Modified: db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/database-support.xml
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/database-support.xml?rev=355281&r1=355280&r2=355281&view=diff
==============================================================================
--- db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/database-support.xml (original)
+++ db/ddlutils/trunk/src/doc/src/documentation/content/xdocs/database-support.xml Thu Dec
 8 15:39:57 2005
@@ -256,7 +256,7 @@
         </tr>
         <tr>
           <td>BIGINT</td>
-          <td>BIGINT</td>
+          <td>LONG (cvs head has support for BIGINT)</td>
           <td></td>
         </tr>
         <tr>

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/AxionBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/AxionBuilder.java?rev=355281&r1=355280&r2=355281&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/AxionBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/AxionBuilder.java Thu Dec  8 15:39:57
2005
@@ -38,6 +38,8 @@
     public AxionBuilder(PlatformInfo info)
     {
         super(info);
+        info.setUseDelimitedIdentifiers(false);
+        info.setCommentsSupported(false);
     }
 
     /**

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/AxionPlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/AxionPlatform.java?rev=355281&r1=355280&r2=355281&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/AxionPlatform.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/AxionPlatform.java Thu Dec  8
15:39:57 2005
@@ -62,6 +62,7 @@
         info.addNativeTypeMapping(Types.SMALLINT,      "SHORT");
         info.addNativeTypeMapping(Types.STRUCT,        "VARBINARY");
         info.addNativeTypeMapping(Types.TINYINT,       "SHORT");
+        info.addNativeTypeMapping(Types.BIGINT,        "LONG");
         info.addNativeTypeMapping("DATALINK", "VARBINARY");
 
         setSqlBuilder(new AxionBuilder(info));

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAgainstAxionDb.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAgainstAxionDb.java?rev=355281&r1=355280&r2=355281&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAgainstAxionDb.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/TestAgainstAxionDb.java Thu Dec  8 15:39:57
2005
@@ -17,6 +17,7 @@
  */
 
 import org.apache.ddlutils.TestDatabaseWriterBase;
+import org.apache.ddlutils.platform.AxionPlatform;
 
 /**
  * Performs tests against Axion.
@@ -64,5 +65,13 @@
     public void _testCreation() throws Exception
     {
         createDatabase(COLUMN_TEST_SCHEMA);
+    }
+
+    /**
+     * @see org.apache.ddlutils.TestDatabaseWriterBase#getDatabaseName()
+     */
+    protected String getDatabaseName()
+    {
+        return AxionPlatform.DATABASENAME;
     }
 }

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestAxionPlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestAxionPlatform.java?rev=355281&r1=355280&r2=355281&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestAxionPlatform.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/platform/TestAxionPlatform.java Thu Dec
 8 15:39:57 2005
@@ -41,40 +41,40 @@
     public void testColumnTypes() throws Exception
     {
         assertEqualsIgnoringWhitespaces(
-            "DROP TABLE IF EXISTS \"coltype\";\n"+
-            "CREATE TABLE \"coltype\"\n"+
+            "DROP TABLE IF EXISTS coltype;\n"+
+            "CREATE TABLE coltype\n"+
             "(\n"+
-            "    \"COL_ARRAY\"           BLOB,\n"+
-            "    \"COL_BIGINT\"          BIGINT,\n"+
-            "    \"COL_BINARY\"          VARBINARY,\n"+
-            "    \"COL_BIT\"             BOOLEAN,\n"+
-            "    \"COL_BLOB\"            BLOB,\n"+
-            "    \"COL_BOOLEAN\"         BOOLEAN,\n"+
-            "    \"COL_CHAR\"            CHAR(15),\n"+
-            "    \"COL_CLOB\"            CLOB,\n"+
-            "    \"COL_DATALINK\"        VARBINARY,\n"+
-            "    \"COL_DATE\"            DATE,\n"+
-            "    \"COL_DECIMAL\"         NUMBER(15,3),\n"+
-            "    \"COL_DECIMAL_NOSCALE\" NUMBER(15,0),\n"+
-            "    \"COL_DISTINCT\"        VARBINARY,\n"+
-            "    \"COL_DOUBLE\"          FLOAT,\n"+
-            "    \"COL_FLOAT\"           FLOAT,\n"+
-            "    \"COL_INTEGER\"         INTEGER,\n"+
-            "    \"COL_JAVA_OBJECT\"     JAVA_OBJECT,\n"+
-            "    \"COL_LONGVARBINARY\"   VARBINARY,\n"+
-            "    \"COL_LONGVARCHAR\"     VARCHAR,\n"+
-            "    \"COL_NULL\"            VARBINARY,\n"+
-            "    \"COL_NUMERIC\"         NUMBER(15,0),\n"+
-            "    \"COL_OTHER\"           BLOB,\n"+
-            "    \"COL_REAL\"            FLOAT,\n"+
-            "    \"COL_REF\"             VARBINARY,\n"+
-            "    \"COL_SMALLINT\"        SHORT,\n"+
-            "    \"COL_STRUCT\"          VARBINARY,\n"+
-            "    \"COL_TIME\"            TIME,\n"+
-            "    \"COL_TIMESTAMP\"       TIMESTAMP,\n"+
-            "    \"COL_TINYINT\"         SHORT,\n"+
-            "    \"COL_VARBINARY\"       VARBINARY(15),\n"+
-            "    \"COL_VARCHAR\"         VARCHAR(15)\n"+
+            "    COL_ARRAY           BLOB,\n"+
+            "    COL_BIGINT          LONG,\n"+
+            "    COL_BINARY          VARBINARY,\n"+
+            "    COL_BIT             BOOLEAN,\n"+
+            "    COL_BLOB            BLOB,\n"+
+            "    COL_BOOLEAN         BOOLEAN,\n"+
+            "    COL_CHAR            CHAR(15),\n"+
+            "    COL_CLOB            CLOB,\n"+
+            "    COL_DATALINK        VARBINARY,\n"+
+            "    COL_DATE            DATE,\n"+
+            "    COL_DECIMAL         NUMBER(15,3),\n"+
+            "    COL_DECIMAL_NOSCALE NUMBER(15,0),\n"+
+            "    COL_DISTINCT        VARBINARY,\n"+
+            "    COL_DOUBLE          FLOAT,\n"+
+            "    COL_FLOAT           FLOAT,\n"+
+            "    COL_INTEGER         INTEGER,\n"+
+            "    COL_JAVA_OBJECT     JAVA_OBJECT,\n"+
+            "    COL_LONGVARBINARY   VARBINARY,\n"+
+            "    COL_LONGVARCHAR     VARCHAR,\n"+
+            "    COL_NULL            VARBINARY,\n"+
+            "    COL_NUMERIC         NUMBER(15,0),\n"+
+            "    COL_OTHER           BLOB,\n"+
+            "    COL_REAL            FLOAT,\n"+
+            "    COL_REF             VARBINARY,\n"+
+            "    COL_SMALLINT        SHORT,\n"+
+            "    COL_STRUCT          VARBINARY,\n"+
+            "    COL_TIME            TIME,\n"+
+            "    COL_TIMESTAMP       TIMESTAMP,\n"+
+            "    COL_TINYINT         SHORT,\n"+
+            "    COL_VARBINARY       VARBINARY(15),\n"+
+            "    COL_VARCHAR         VARCHAR(15)\n"+
             ");\n",
             createTestDatabase(COLUMN_TEST_SCHEMA));
     }
@@ -85,16 +85,16 @@
     public void testColumnConstraints() throws Exception
     {
         assertEqualsIgnoringWhitespaces(
-            "DROP TABLE IF EXISTS \"constraints\";\n" +
-            "CREATE TABLE \"constraints\"\n"+
+            "DROP TABLE IF EXISTS constraints;\n" +
+            "CREATE TABLE constraints\n"+
             "(\n"+
-            "    \"COL_PK\"               VARCHAR(32),\n"+
-            "    \"COL_PK_AUTO_INCR\"     INTEGER IDENTITY,\n"+
-            "    \"COL_NOT_NULL\"         VARBINARY(100) NOT NULL,\n"+
-            "    \"COL_NOT_NULL_DEFAULT\" FLOAT DEFAULT '-2.0' NOT NULL,\n"+
-            "    \"COL_DEFAULT\"          CHAR(4) DEFAULT 'test',\n"+
-            "    \"COL_AUTO_INCR\"        BIGINT IDENTITY,\n"+
-            "    PRIMARY KEY (\"COL_PK\", \"COL_PK_AUTO_INCR\")\n"+
+            "    COL_PK               VARCHAR(32),\n"+
+            "    COL_PK_AUTO_INCR     INTEGER IDENTITY,\n"+
+            "    COL_NOT_NULL         VARBINARY(100) NOT NULL,\n"+
+            "    COL_NOT_NULL_DEFAULT FLOAT DEFAULT '-2.0' NOT NULL,\n"+
+            "    COL_DEFAULT          CHAR(4) DEFAULT 'test',\n"+
+            "    COL_AUTO_INCR        LONG IDENTITY,\n"+
+            "    PRIMARY KEY (COL_PK, COL_PK_AUTO_INCR)\n"+
             ");\n",
             createTestDatabase(COLUMN_CONSTRAINT_TEST_SCHEMA));
     }
@@ -105,37 +105,37 @@
     public void testTableConstraints() throws Exception
     {
         assertEqualsIgnoringWhitespaces(
-            "ALTER TABLE \"table3\" DROP CONSTRAINT \"testfk\";\n"+
-            "ALTER TABLE \"table2\" DROP CONSTRAINT \"table2_FK_COL_FK_1_COL_FK_2_table1\";\n"+
-            "DROP TABLE IF EXISTS \"table3\";\n"+
-            "DROP TABLE IF EXISTS \"table2\";\n"+
-            "DROP TABLE IF EXISTS \"table1\";\n"+
-            "CREATE TABLE \"table1\"\n"+
+            "ALTER TABLE table3 DROP CONSTRAINT testfk;\n"+
+            "ALTER TABLE table2 DROP CONSTRAINT table2_FK_COL_FK_1_COL_FK_2_table1;\n"+
+            "DROP TABLE IF EXISTS table3;\n"+
+            "DROP TABLE IF EXISTS table2;\n"+
+            "DROP TABLE IF EXISTS table1;\n"+
+            "CREATE TABLE table1\n"+
             "(\n"+
-            "    \"COL_PK_1\"    VARCHAR(32) NOT NULL,\n"+
-            "    \"COL_PK_2\"    INTEGER,\n"+
-            "    \"COL_INDEX_1\" VARBINARY(100) NOT NULL,\n"+
-            "    \"COL_INDEX_2\" FLOAT NOT NULL,\n"+
-            "    \"COL_INDEX_3\" CHAR(4),\n"+
-            "    PRIMARY KEY (\"COL_PK_1\", \"COL_PK_2\")\n"+
+            "    COL_PK_1    VARCHAR(32) NOT NULL,\n"+
+            "    COL_PK_2    INTEGER,\n"+
+            "    COL_INDEX_1 VARBINARY(100) NOT NULL,\n"+
+            "    COL_INDEX_2 FLOAT NOT NULL,\n"+
+            "    COL_INDEX_3 CHAR(4),\n"+
+            "    PRIMARY KEY (COL_PK_1, COL_PK_2)\n"+
             ");\n"+
-            "CREATE INDEX \"testindex1\" ON \"table1\" (\"COL_INDEX_2\");\n"+
-            "CREATE UNIQUE INDEX \"testindex2\" ON \"table1\" (\"COL_INDEX_3\", \"COL_INDEX_1\");\n"+
-            "CREATE TABLE \"table2\"\n"+
+            "CREATE INDEX testindex1 ON table1 (COL_INDEX_2);\n"+
+            "CREATE UNIQUE INDEX testindex2 ON table1 (COL_INDEX_3, COL_INDEX_1);\n"+
+            "CREATE TABLE table2\n"+
             "(\n"+
-            "    \"COL_PK\"   INTEGER,\n"+
-            "    \"COL_FK_1\" INTEGER,\n"+
-            "    \"COL_FK_2\" VARCHAR(32) NOT NULL,\n"+
-            "    PRIMARY KEY (\"COL_PK\")\n"+
+            "    COL_PK   INTEGER,\n"+
+            "    COL_FK_1 INTEGER,\n"+
+            "    COL_FK_2 VARCHAR(32) NOT NULL,\n"+
+            "    PRIMARY KEY (COL_PK)\n"+
             ");\n"+
-            "CREATE TABLE \"table3\"\n"+
+            "CREATE TABLE table3\n"+
             "(\n"+
-            "    \"COL_PK\" VARCHAR(16),\n"+
-            "    \"COL_FK\" INTEGER NOT NULL,\n"+
-            "    PRIMARY KEY (\"COL_PK\")\n"+
+            "    COL_PK VARCHAR(16),\n"+
+            "    COL_FK INTEGER NOT NULL,\n"+
+            "    PRIMARY KEY (COL_PK)\n"+
             ");\n"+
-            "ALTER TABLE \"table2\" ADD CONSTRAINT \"table2_FK_COL_FK_1_COL_FK_2_table1\"
FOREIGN KEY (\"COL_FK_1\", \"COL_FK_2\") REFERENCES \"table1\" (\"COL_PK_2\", \"COL_PK_1\");\n"+
-            "ALTER TABLE \"table3\" ADD CONSTRAINT \"testfk\" FOREIGN KEY (\"COL_FK\") REFERENCES
\"table2\" (\"COL_PK\");\n",
+            "ALTER TABLE table2 ADD CONSTRAINT table2_FK_COL_FK_1_COL_FK_2_table1 FOREIGN
KEY (COL_FK_1, COL_FK_2) REFERENCES table1 (COL_PK_2, COL_PK_1);\n"+
+            "ALTER TABLE table3 ADD CONSTRAINT testfk FOREIGN KEY (COL_FK) REFERENCES table2
(COL_PK);\n",
             createTestDatabase(TABLE_CONSTRAINT_TEST_SCHEMA));
     }
 }



Mime
View raw message