db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r359921 - in /db/ddlutils/trunk/src: java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java java/org/apache/ddlutils/platform/postgresql/PostgreSqlPlatform.java test/org/apache/ddlutils/io/RoundtripTestBase.java
Date Thu, 29 Dec 2005 23:15:29 GMT
Author: tomdz
Date: Thu Dec 29 15:15:19 2005
New Revision: 359921

URL: http://svn.apache.org/viewcvs?rev=359921&view=rev
Log:
Fixed some issues with PostgreSql

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlPlatform.java
    db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java?rev=359921&r1=359920&r2=359921&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java
(original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlModelReader.java
Thu Dec 29 15:15:19 2005
@@ -24,6 +24,9 @@
 
 /**
  * Reads a database model from a PostgreSql database.
+ * 
+ * TODO: Add default value parsing which are of the form '-9000000000000000000::bigint' or
+ *       ''some value'::character varying' or ''2000-01-01'::date'
  *
  * @author Thomas Dudziak
  * @version $Revision: $

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlPlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlPlatform.java?rev=359921&r1=359920&r2=359921&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlPlatform.java
(original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/postgresql/PostgreSqlPlatform.java
Thu Dec 29 15:15:19 2005
@@ -57,24 +57,25 @@
         info.setPrimaryKeyEmbedded(true);
         info.setForeignKeysEmbedded(false);
         info.setIndicesEmbedded(false);
-        info.addNativeTypeMapping(Types.ARRAY,         "BYTEA");
-        info.addNativeTypeMapping(Types.BINARY,        "BYTEA");
+        info.addNativeTypeMapping(Types.ARRAY,         "BYTEA",            Types.BINARY);
+        info.addNativeTypeMapping(Types.BINARY,        "BYTEA",            Types.BINARY);
         info.addNativeTypeMapping(Types.BIT,           "BOOLEAN");
         info.addNativeTypeMapping(Types.BLOB,          "BYTEA");
         info.addNativeTypeMapping(Types.CLOB,          "TEXT");
-        info.addNativeTypeMapping(Types.DECIMAL,       "NUMERIC");
-        info.addNativeTypeMapping(Types.DISTINCT,      "BYTEA");
+        info.addNativeTypeMapping(Types.DECIMAL,       "NUMERIC",          Types.NUMERIC);
+        info.addNativeTypeMapping(Types.DISTINCT,      "BYTEA",            Types.BINARY);
         info.addNativeTypeMapping(Types.DOUBLE,        "DOUBLE PRECISION");
-        info.addNativeTypeMapping(Types.FLOAT,         "DOUBLE PRECISION");
-        info.addNativeTypeMapping(Types.JAVA_OBJECT,   "BYTEA");
-        info.addNativeTypeMapping(Types.LONGVARBINARY, "BYTEA");
-        info.addNativeTypeMapping(Types.LONGVARCHAR,   "TEXT");
-        info.addNativeTypeMapping(Types.NULL,          "BYTEA");
-        info.addNativeTypeMapping(Types.OTHER,         "BYTEA");
-        info.addNativeTypeMapping(Types.REF,           "BYTEA");
-        info.addNativeTypeMapping(Types.STRUCT,        "BYTEA");
-        info.addNativeTypeMapping(Types.TINYINT,       "SMALLINT");
-        info.addNativeTypeMapping(Types.VARBINARY,     "BYTEA");
+        info.addNativeTypeMapping(Types.FLOAT,         "DOUBLE PRECISION", Types.DOUBLE);
+        info.addNativeTypeMapping(Types.JAVA_OBJECT,   "BYTEA",            Types.BINARY);
+        info.addNativeTypeMapping(Types.LONGVARBINARY, "BYTEA",            Types.BINARY);
+        info.addNativeTypeMapping(Types.LONGVARCHAR,   "TEXT",             Types.VARCHAR);
+        info.addNativeTypeMapping(Types.NULL,          "BYTEA",            Types.BINARY);
+        info.addNativeTypeMapping(Types.OTHER,         "BYTEA",            Types.BINARY);
+        info.addNativeTypeMapping(Types.REF,           "BYTEA",            Types.BINARY);
+        info.addNativeTypeMapping(Types.STRUCT,        "BYTEA",            Types.BINARY);
+        info.addNativeTypeMapping(Types.TINYINT,       "SMALLINT",         Types.SMALLINT);
+        info.addNativeTypeMapping(Types.VARBINARY,     "BYTEA",            Types.BINARY);
+        info.addNativeTypeMapping("BOOLEAN",  "BOOLEAN", "BIT");
         info.addNativeTypeMapping("DATALINK", "BYTEA");
 
         // no support for specifying the size for these types

Modified: db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java?rev=359921&r1=359920&r2=359921&view=diff
==============================================================================
--- db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java (original)
+++ db/ddlutils/trunk/src/test/org/apache/ddlutils/io/RoundtripTestBase.java Thu Dec 29 15:15:19
2005
@@ -87,11 +87,21 @@
      */
     protected List getRows(String tableName)
     {
-        Table table = getModel().findTable(tableName);
+        Table        table = getModel().findTable(tableName, getPlatformInfo().isCaseSensitive());
+        StringBuffer query = new StringBuffer();
 
-        return getPlatform().fetch(getModel(),
-                                   "SELECT * FROM " + tableName,
-                                   new Table[] { table });
+        query.append("SELECT * FROM ");
+        if (getPlatformInfo().isUseDelimitedIdentifiers())
+        {
+            query.append(getPlatformInfo().getDelimiterToken());
+        }
+        query.append(table.getName());
+        if (getPlatformInfo().isUseDelimitedIdentifiers())
+        {
+            query.append(getPlatformInfo().getDelimiterToken());
+        }
+        
+        return getPlatform().fetch(getModel(), query.toString(), new Table[] { table });
     }
 
     /**



Mime
View raw message