You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by to...@apache.org on 2006/03/01 00:18:16 UTC

svn commit: r381816 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java

Author: tomdz
Date: Tue Feb 28 15:18:12 2006
New Revision: 381816

URL: http://svn.apache.org/viewcvs?rev=381816&view=rev
Log:
Now also the table name columns are retrieved from the jdbc metadata for columns, primary keys, indices, foreign keys to allow databases to utilize them
Made readColumns protected so that it can be redefined by concrete implementations

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java?rev=381816&r1=381815&r2=381816&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java Tue Feb 28 15:18:12 2006
@@ -159,6 +159,8 @@
         // has problems otherwise (it seemingly requires a LONG column to be the first to be read)
         // See also DDLUTILS-29
         result.add(new MetaDataColumnDescriptor("COLUMN_DEF",     Types.VARCHAR));
+        // we're also reading the table name so that a model reader impl can filter manually
+        result.add(new MetaDataColumnDescriptor("TABLE_NAME",     Types.VARCHAR));
         result.add(new MetaDataColumnDescriptor("COLUMN_NAME",    Types.VARCHAR));
         result.add(new MetaDataColumnDescriptor("DATA_TYPE",      Types.INTEGER, new Integer(java.sql.Types.OTHER)));
         result.add(new MetaDataColumnDescriptor("NUM_PREC_RADIX", Types.INTEGER, new Integer(10)));
@@ -183,6 +185,8 @@
         List result = new ArrayList();
 
         result.add(new MetaDataColumnDescriptor("COLUMN_NAME", Types.VARCHAR));
+        // we're also reading the table name so that a model reader impl can filter manually
+        result.add(new MetaDataColumnDescriptor("TABLE_NAME",  Types.VARCHAR));
 
         return result;
     }
@@ -200,6 +204,8 @@
         List result = new ArrayList();
 
         result.add(new MetaDataColumnDescriptor("PKTABLE_NAME",  Types.VARCHAR));
+        // we're also reading the table name so that a model reader impl can filter manually
+        result.add(new MetaDataColumnDescriptor("FKTABLE_NAME",  Types.VARCHAR));
         result.add(new MetaDataColumnDescriptor("KEY_SEQ",       Types.TINYINT, new Short((short)0)));
         result.add(new MetaDataColumnDescriptor("FK_NAME",       Types.VARCHAR));
         result.add(new MetaDataColumnDescriptor("PKCOLUMN_NAME", Types.VARCHAR));
@@ -221,6 +227,8 @@
         List result = new ArrayList();
 
         result.add(new MetaDataColumnDescriptor("INDEX_NAME",       Types.VARCHAR));
+        // we're also reading the table name so that a model reader impl can filter manually
+        result.add(new MetaDataColumnDescriptor("TABLE_NAME",       Types.VARCHAR));
         result.add(new MetaDataColumnDescriptor("NON_UNIQUE",       Types.BIT, Boolean.TRUE));
         result.add(new MetaDataColumnDescriptor("ORDINAL_POSITION", Types.TINYINT, new Short((short)0)));
         result.add(new MetaDataColumnDescriptor("COLUMN_NAME",      Types.VARCHAR));
@@ -653,7 +661,7 @@
      * @param tableName The name of the table
      * @return The columns
      */
-    private Collection readColumns(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException
+    protected Collection readColumns(DatabaseMetaDataWrapper metaData, String tableName) throws SQLException
     {
         ResultSet columnData = null;