db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r382580 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java
Date Fri, 03 Mar 2006 00:07:07 GMT
Author: tomdz
Date: Thu Mar  2 16:07:06 2006
New Revision: 382580

URL: http://svn.apache.org/viewcvs?rev=382580&view=rev
Log:
Added ability to override the column name pattern for model readers (for use when calling
the DatabaseMetaData#getColumns method)

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=382580&r1=382579&r2=382580&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 Thu Mar 
2 16:07:06 2006
@@ -77,6 +77,8 @@
     private String _defaultSchemaPattern = "%";
     /** The default pattern for reading all tables. */
     private String _defaultTablePattern = "%";
+    /** The default pattern for reading all columns. */
+    private String _defaultColumnPattern;
     /** The table types to recognize per default. */
     private String[] _defaultTableTypes = { "TABLE" };
     /** The active connection while reading a database model. */
@@ -298,6 +300,26 @@
     }
 
     /**
+     * Returns the default pattern to read the relevant columns from the database.
+     *
+     * @return The column pattern
+     */
+    public String getDefaultColumnPattern()
+    {
+        return _defaultColumnPattern;
+    }
+
+    /**
+     * Sets the default pattern to read the relevant columns from the database.
+     *
+     * @param columnPattern The column pattern
+     */
+    public void setDefaultColumnPattern(String columnPattern)
+    {
+        _defaultColumnPattern = columnPattern;
+    }
+
+    /**
      * Returns the table types to recognize per default.
      *
      * @return The default table types
@@ -667,7 +689,7 @@
 
         try
         {
-            columnData = metaData.getColumns(tableName, null);
+            columnData = metaData.getColumns(tableName, getDefaultColumnPattern());
 
             List columns = new ArrayList();
 



Mime
View raw message