db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r358970 - in /db/ddlutils/trunk/src/java/org/apache/ddlutils: ./ model/ platform/ task/
Date Sun, 25 Dec 2005 12:24:18 GMT
Author: tomdz
Date: Sun Dec 25 04:24:05 2005
New Revision: 358970

URL: http://svn.apache.org/viewcvs?rev=358970&view=rev
Log:
Added ability to specify in the platform info to which jdbc type a native type would be mapped
back
Added parameter to specify the name of the model read back from the database

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/Platform.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Database.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/CloudscapePlatform.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/DefaultValueHelper.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/JdbcModelReader.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseToDdlTask.java
    db/ddlutils/trunk/src/java/org/apache/ddlutils/task/WriteSchemaSqlToFileCommand.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/Platform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/Platform.java?rev=358970&r1=358969&r2=358970&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/Platform.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/Platform.java Sun Dec 25 04:24:05 2005
@@ -682,41 +682,49 @@
      * Reads the database model from the live database as specified by the data source set
for
      * this platform.
      * 
+     * @param name The name of the resulting database; <code>null</code> when
the default name (the catalog)
+     *             is desired which might be <code>null</code> itself though
      * @return The database model
      * @throws DynaSqlException If an error occurred during reading the model
      */
-    public Database readModelFromDatabase() throws DynaSqlException;
+    public Database readModelFromDatabase(String name) throws DynaSqlException;
 
     /**
      * Reads the database model from the live database as specified by the data source set
for
      * this platform.
      * 
+     * @param name       The name of the resulting database; <code>null</code>
when the default name (the catalog)
+     *                   is desired which might be <code>null</code> itself though
      * @param catalog    The catalog to access in the database; use <code>null</code>
for the default value
      * @param schema     The schema to access in the database; use <code>null</code>
for the default value
      * @param tableTypes The table types to process; use <code>null</code> or
an empty list for the default ones
      * @return The database model
      * @throws DynaSqlException If an error occurred during reading the model
      */
-    public Database readModelFromDatabase(String catalog, String schema, String[] tableTypes)
throws DynaSqlException;
+    public Database readModelFromDatabase(String name, String catalog, String schema, String[]
tableTypes) throws DynaSqlException;
 
     /**
      * Reads the database model from the live database to which the given connection is pointing.
      * 
      * @param connection The connection to the database
+     * @param name       The name of the resulting database; <code>null</code>
when the default name (the catalog)
+     *                   is desired which might be <code>null</code> itself though
      * @return The database model
      * @throws DynaSqlException If an error occurred during reading the model
      */
-    public Database readModelFromDatabase(Connection connection) throws DynaSqlException;
+    public Database readModelFromDatabase(Connection connection, String name) throws DynaSqlException;
 
     /**
      * Reads the database model from the live database to which the given connection is pointing.
      * 
      * @param connection The connection to the database
+     * @param name       The name of the resulting database; <code>null</code>
when the default name (the catalog)
+     *                   is desired which might be <code>null</code> itself though
      * @param catalog    The catalog to access in the database; use <code>null</code>
for the default value
      * @param schema     The schema to access in the database; use <code>null</code>
for the default value
      * @param tableTypes The table types to process; use <code>null</code> or
an empty list for the default ones
      * @return The database model
      * @throws DynaSqlException If an error occurred during reading the model
      */
-    public Database readModelFromDatabase(Connection connection, String catalog, String schema,
String[] tableTypes) throws DynaSqlException;
+    public Database readModelFromDatabase(Connection connection, String name, String catalog,
String schema, String[] tableTypes) throws DynaSqlException;
 }

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java?rev=358970&r1=358969&r2=358970&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformInfo.java Sun Dec 25 04:24:05 2005
@@ -84,6 +84,9 @@
     /** Contains non-default mappings from jdbc to native types. */
     private HashMap _nativeTypes = new HashMap();
 
+    /** Contains the jdbc types corresponding to the native types for non-default mappings.
*/
+    private HashMap _targetJdbcTypes = new HashMap();
+
     /** Contains those JDBC types whose corresponding native types have a null value as the
default value. */
     private HashSet _typesWithNullDefault = new HashSet();
 
@@ -448,6 +451,20 @@
     }
 
     /**
+     * Adds a mapping from jdbc type to database-native type.
+     * 
+     * @param jdbcTypeCode       The jdbc type code as defined by {@link java.sql.Types}
+     * @param nativeType         The native type
+     * @param targetJdbcTypeCode The jdbc type code corresponding to the native type
+     *                           (e.g. when reading the model from the database)
+     */
+    public void addNativeTypeMapping(int jdbcTypeCode, String nativeType, int targetJdbcTypeCode)
+    {
+        addNativeTypeMapping(jdbcTypeCode, nativeType);
+        _targetJdbcTypes.put(new Integer(jdbcTypeCode), new Integer(targetJdbcTypeCode));
+    }
+
+    /**
      * Adds a mapping from jdbc type to database-native type. Note that this
      * method accesses the named constant in {@link java.sql.Types} via reflection
      * and is thus safe to use under JDK 1.2/1.3 even with constants defined
@@ -477,6 +494,38 @@
     }
 
     /**
+     * Adds a mapping from jdbc type to database-native type. Note that this
+     * method accesses the named constant in {@link java.sql.Types} via reflection
+     * and is thus safe to use under JDK 1.2/1.3 even with constants defined
+     * only in later Java versions - for these, the method simply will not add
+     * a mapping.
+     * 
+     * @param jdbcTypeName       The jdbc type name, one of the constants defined
+     *                           in {@link java.sql.Types}
+     * @param nativeType         The native type
+     * @param targetJdbcTypeName The jdbc type corresponding to the native type
+     *                           (e.g. when reading the model from the database)
+     */
+    public void addNativeTypeMapping(String jdbcTypeName, String nativeType, String targetJdbcTypeName)
+    {
+        try
+        {
+            Field sourceType = Types.class.getField(jdbcTypeName);
+            Field targetType = Types.class.getField(targetJdbcTypeName);
+
+            if ((sourceType != null) && (targetType != null))
+            {
+                addNativeTypeMapping(sourceType.getInt(null), nativeType, targetType.getInt(null));
+            }
+        }
+        catch (Exception ex)
+        {
+            // ignore -> won't be defined
+            _log.warn("Cannot add native type mapping for undefined jdbc type "+jdbcTypeName+",
target jdbc type "+targetJdbcTypeName, ex);
+        }
+    }
+
+    /**
      * Returns the database-native type for the given type code.
      * 
      * @param typeCode The {@link java.sql.Types} type code
@@ -485,6 +534,23 @@
     public String getNativeType(int typeCode)
     {
         return (String)_nativeTypes.get(new Integer(typeCode));
+    }
+
+    /**
+     * Returns the jdbc type corresponding to the native type that is used for the given
+     * jdbc type. This is most often the same jdbc type, but can also be a different one.
+     * For instance, if a database has no native boolean type, then the source jdbc type
+     * would be <code>BIT</code> or <code>BOOLEAN</code>, and the
target jdbc type might
+     * be <code>TINYINT</code> or <code>SMALLINT</code>.
+     * 
+     * @param typeCode The {@link java.sql.Types} type code
+     * @return The target jdbc type
+     */
+    public int getTargetJdbcType(int typeCode)
+    {
+        Integer targetJdbcType = (Integer)_targetJdbcTypes.get(new Integer(typeCode));
+
+        return targetJdbcType == null ? typeCode : targetJdbcType.intValue(); 
     }
 
     /**

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Database.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Database.java?rev=358970&r1=358969&r2=358970&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Database.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/model/Database.java Sun Dec 25 04:24:05
2005
@@ -495,7 +495,7 @@
     /**
      * {@inheritDoc}
      */
-    protected Object clone() throws CloneNotSupportedException
+    public Object clone() throws CloneNotSupportedException
     {
         Database result = (Database)super.clone();
 

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/CloudscapePlatform.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/CloudscapePlatform.java?rev=358970&r1=358969&r2=358970&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/CloudscapePlatform.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/CloudscapePlatform.java Sun Dec
25 04:24:05 2005
@@ -48,23 +48,23 @@
         info.setIndicesEmbedded(false);
         info.setMaxIdentifierLength(128);
         // BINARY and VARBINARY will also be handled by CloudscapeBuilder.getSqlType
-        info.addNativeTypeMapping(Types.ARRAY,         "BLOB");
+        info.addNativeTypeMapping(Types.ARRAY,         "BLOB",                     Types.BLOB);
         info.addNativeTypeMapping(Types.BINARY,        "CHAR");
-        info.addNativeTypeMapping(Types.BIT,           "SMALLINT");
-        info.addNativeTypeMapping(Types.DISTINCT,      "BLOB");
+        info.addNativeTypeMapping(Types.BIT,           "SMALLINT",                 Types.SMALLINT);
+        info.addNativeTypeMapping(Types.DISTINCT,      "BLOB",                     Types.BLOB);
         info.addNativeTypeMapping(Types.DOUBLE,        "DOUBLE PRECISION");
-        info.addNativeTypeMapping(Types.FLOAT,         "DOUBLE PRECISION");
-        info.addNativeTypeMapping(Types.JAVA_OBJECT,   "BLOB");
+        info.addNativeTypeMapping(Types.FLOAT,         "DOUBLE PRECISION",         Types.DOUBLE);
+        info.addNativeTypeMapping(Types.JAVA_OBJECT,   "BLOB",                     Types.BLOB);
         info.addNativeTypeMapping(Types.LONGVARBINARY, "LONG VARCHAR FOR BIT DATA");
         info.addNativeTypeMapping(Types.LONGVARCHAR,   "LONG VARCHAR");
-        info.addNativeTypeMapping(Types.OTHER,         "BLOB");
-        info.addNativeTypeMapping(Types.NULL,          "LONG VARCHAR FOR BIT DATA");
-        info.addNativeTypeMapping(Types.REF,           "LONG VARCHAR FOR BIT DATA");
-        info.addNativeTypeMapping(Types.STRUCT,        "BLOB");
-        info.addNativeTypeMapping(Types.TINYINT,       "SMALLINT");
+        info.addNativeTypeMapping(Types.OTHER,         "BLOB",                      Types.BLOB);
+        info.addNativeTypeMapping(Types.NULL,          "LONG VARCHAR FOR BIT DATA", Types.LONGVARBINARY);
+        info.addNativeTypeMapping(Types.REF,           "LONG VARCHAR FOR BIT DATA", Types.LONGVARBINARY);
+        info.addNativeTypeMapping(Types.STRUCT,        "BLOB",                      Types.BLOB);
+        info.addNativeTypeMapping(Types.TINYINT,       "SMALLINT",                  Types.SMALLINT);
         info.addNativeTypeMapping(Types.VARBINARY,     "VARCHAR");
-        info.addNativeTypeMapping("BOOLEAN",  "SMALLINT");
-        info.addNativeTypeMapping("DATALINK", "LONG VARCHAR FOR BIT DATA");
+        info.addNativeTypeMapping("BOOLEAN",  "SMALLINT",                  "SMALLINT");
+        info.addNativeTypeMapping("DATALINK", "LONG VARCHAR FOR BIT DATA", "LONGVARBINARY");
 
         setSqlBuilder(new CloudscapeBuilder(info));
     }

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/DefaultValueHelper.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/DefaultValueHelper.java?rev=358970&r1=358969&r2=358970&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/DefaultValueHelper.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/DefaultValueHelper.java Sun Dec
25 04:24:05 2005
@@ -24,22 +24,22 @@
      * @param targetTypeCode   The target type code
      * @return The converted default value 
      */
-    public Object convert(String defaultValue, int originalTypeCode, int targetTypeCode)
+    public String convert(String defaultValue, int originalTypeCode, int targetTypeCode)
     {
-        Object result = defaultValue;
+        String result = defaultValue;
 
         if (defaultValue != null)
         {
             switch (originalTypeCode)
             {
                 case Types.BIT:
-                    result = convertBoolean(defaultValue, targetTypeCode);
+                    result = convertBoolean(defaultValue, targetTypeCode).toString();
                     break;
                 default:
                     if (Jdbc3Utils.supportsJava14JdbcTypes() &&
                         (originalTypeCode == Jdbc3Utils.determineBooleanTypeCode()))
                     {
-                        result = convertBoolean(defaultValue, targetTypeCode);
+                        result = convertBoolean(defaultValue, targetTypeCode).toString();
                     }
                     break;
             }

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=358970&r1=358969&r2=358970&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 Sun Dec 25
04:24:05 2005
@@ -152,41 +152,48 @@
      * Reads the database model from the given connection.
      * 
      * @param connection The connection
+     * @param name       The name of the resulting database; <code>null</code>
when the default name (the catalog)
+     *                   is desired which might be <code>null</code> itself though
      * @return The database model
      */
-    public Database getDatabase(Connection connection) throws SQLException
+    public Database getDatabase(Connection connection, String name) throws SQLException
     {
-        return getDatabase(connection, null, null, null);
+        return getDatabase(connection, name, null, null, null);
     }
 
     /**
      * Reads the database model from the given connection.
      * 
      * @param connection The connection
+     * @param name       The name of the resulting database; <code>null</code>
when the default name (the catalog)
+     *                   is desired which might be <code>null</code> itself though
      * @param catalog    The catalog to acess in the database; use <code>null</code>
for the default value
      * @param schema     The schema to acess in the database; use <code>null</code>
for the default value
      * @param tableTypes The table types to process; use <code>null</code> or
an empty list for the default ones
      * @return The database model
      */
-    public Database getDatabase(Connection connection, String catalog, String schema, String[]
tableTypes) throws SQLException
+    public Database getDatabase(Connection connection, String name, String catalog, String
schema, String[] tableTypes) throws SQLException
     {
         Database db = new Database();
 
-        try 
+        if (name == null)
         {
-            db.setName(connection.getCatalog());
-            if (catalog == null)
+            try 
             {
-                catalog = db.getName();
-            }
-        } 
-        catch(Exception e) 
-        {
-            _log.info("Cannot determine the catalog name from connection.");
-            if (catalog != null)
+                db.setName(connection.getCatalog());
+                if (catalog == null)
+                {
+                    catalog = db.getName();
+                }
+            } 
+            catch(Exception e) 
             {
-                db.setName(catalog);
+                _log.info("Cannot determine the catalog name from connection.");
             }
+        }
+        else
+        {
+            db.setName(name);
         }
         for (Iterator it = getTables(connection, catalog, schema, tableTypes).iterator();
it.hasNext();)
         {

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java?rev=358970&r1=358969&r2=358970&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/PlatformImplBase.java Sun Dec
25 04:24:05 2005
@@ -456,7 +456,7 @@
     public String getAlterTablesSql(Connection connection, Database desiredModel, boolean
doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
     {
         String   sql          = null;
-        Database currentModel = readModelFromDatabase(connection);
+        Database currentModel = readModelFromDatabase(connection, desiredModel.getName());
 
         try
         {
@@ -497,7 +497,7 @@
     public String getAlterTablesSql(Connection connection, Database desiredModel, CreationParameters
params, boolean doDrops, boolean modifyColumns, boolean continueOnError) throws DynaSqlException
     {
         String   sql          = null;
-        Database currentModel = readModelFromDatabase(connection);
+        Database currentModel = readModelFromDatabase(connection, desiredModel.getName());
 
         try
         {
@@ -1360,19 +1360,19 @@
     /**
      * {@inheritDoc}
      */    
-    public Database readModelFromDatabase() throws DynaSqlException
+    public Database readModelFromDatabase(String name) throws DynaSqlException
     {
-        return readModelFromDatabase(borrowConnection());
+        return readModelFromDatabase(borrowConnection(), name);
     }
 
     /**
      * {@inheritDoc}
      */    
-    public Database readModelFromDatabase(Connection connection) throws DynaSqlException
+    public Database readModelFromDatabase(Connection connection, String name) throws DynaSqlException
     {
         try
         {
-            return getModelReader().getDatabase(connection);
+            return getModelReader().getDatabase(connection, name);
         }
         catch (SQLException ex)
         {
@@ -1383,21 +1383,21 @@
     /**
      * {@inheritDoc}
      */
-    public Database readModelFromDatabase(String catalog, String schema, String[] tableTypes)
throws DynaSqlException
+    public Database readModelFromDatabase(String name, String catalog, String schema, String[]
tableTypes) throws DynaSqlException
     {
-        return readModelFromDatabase(borrowConnection(), catalog, schema, tableTypes);
+        return readModelFromDatabase(borrowConnection(), name, catalog, schema, tableTypes);
     }
 
     /**
      * {@inheritDoc}
      */
-    public Database readModelFromDatabase(Connection connection, String catalog, String schema,
String[] tableTypes) throws DynaSqlException
+    public Database readModelFromDatabase(Connection connection, String name, String catalog,
String schema, String[] tableTypes) throws DynaSqlException
     {
         try
         {
             JdbcModelReader reader = getModelReader();
             
-            return reader.getDatabase(connection, catalog, schema, tableTypes);
+            return reader.getDatabase(connection, name, catalog, schema, tableTypes);
         }
         catch (SQLException ex)
         {

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java?rev=358970&r1=358969&r2=358970&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/SqlBuilder.java Sun Dec 25 04:24:05
2005
@@ -136,7 +136,7 @@
      *
      * @return The default value helper
      */
-    protected DefaultValueHelper getDefaultValueHelper()
+    public DefaultValueHelper getDefaultValueHelper()
     {
         return _defaultValueHelper;
     }
@@ -416,7 +416,7 @@
                 }
                 writeColumnAlterStmt(desiredTable, desiredColumn, true);
             }
-            else if (columnsDiffer(desiredColumn, currentColumn))
+            else if (columnsDiffer(currentColumn, desiredColumn))
             {
                 if (modifyColumns)
                 {
@@ -1266,17 +1266,16 @@
     }
 
     /**
-     * Helper method to determine if two column specifications represent
-     * different types.  Type, nullability, size, scale, default value,
-     * and precision radix are the attributes checked.  Currently default
-     * values are compared where null and empty string are considered equal.
-     * See comments in the method body for explanation.
+     * Compares the current column in the database with the desired one.
+     * Type, nullability, size, scale, default value, and precision radix are
+     * the attributes checked.  Currently default values are compared, and
+     * null and empty string are considered equal.
      *
-     * @param columnA First column to compare
-     * @param columnB Second column to compare
-     * @return <code>true</code> if the columns differ
+     * @param currentColumn The current column as it is in the database
+     * @param desiredColumn The desired column
+     * @return <code>true</code> if the column specifications differ
      */
-    protected boolean columnsDiffer(Column columnA, Column columnB)
+    protected boolean columnsDiffer(Column currentColumn, Column desiredColumn)
     {
         //The createColumn method leaves off the default clause if column.getDefaultValue()
         //is null.  mySQL interprets this as a default of "" or 0, and thus the columns
@@ -1290,14 +1289,16 @@
         //A good way to get this would be to require a defaultValue="<NULL>" in the
         //schema xml if you really want null and not just unspecified.
 
-        String  desiredDefault = columnA.getDefaultValue();
-        String  currentDefault = columnB.getDefaultValue();
+        String  desiredDefault = desiredColumn.getDefaultValue();
+        String  currentDefault = currentColumn.getDefaultValue();
         boolean defaultsEqual  = (desiredDefault == null) || desiredDefault.equals(currentDefault);
-        boolean sizeMatters    = (columnA.getSize() != null);
+        boolean sizeMatters    = (desiredColumn.getSize() != null);
 
-        if ((columnA.getTypeCode() != columnB.getTypeCode()) ||
-            (columnA.isRequired() != columnB.isRequired()) ||
-            (sizeMatters && (!columnA.getSize().equals(columnB.getSize()))) ||
+        // We're comparing the jdbc type that corresponds to the native type for the
+        // desired type, in order to avoid repeated altering of a perfectly valid column
+        if ((getPlatformInfo().getTargetJdbcType(desiredColumn.getTypeCode()) != currentColumn.getTypeCode())
||
+            (desiredColumn.isRequired() != currentColumn.isRequired()) ||
+            (sizeMatters && (!desiredColumn.getSize().equals(currentColumn.getSize())))
||
             !defaultsEqual /*|| //determined these two to be hardly useful
             (columnA.getScale() != columnB.getScale()) ||
             (columnA.getPrecisionRadix() != columnB.getPrecisionRadix())*/ )

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseToDdlTask.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseToDdlTask.java?rev=358970&r1=358969&r2=358970&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseToDdlTask.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseToDdlTask.java Sun Dec 25
04:24:05 2005
@@ -157,7 +157,7 @@
 
         try
         {
-            return getPlatform().readModelFromDatabase(_catalog, _schema, getTableTypes());
+            return getPlatform().readModelFromDatabase(null, _catalog, _schema, getTableTypes());
         }
         catch (Exception ex)
         {

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/task/WriteSchemaSqlToFileCommand.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/task/WriteSchemaSqlToFileCommand.java?rev=358970&r1=358969&r2=358970&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/task/WriteSchemaSqlToFileCommand.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/task/WriteSchemaSqlToFileCommand.java Sun
Dec 25 04:24:05 2005
@@ -119,7 +119,7 @@
             platform.getSqlBuilder().setWriter(writer);
             if (isAlterDatabase() && (getDataSource() != null))
             {
-                Database currentModel = platform.readModelFromDatabase();
+                Database currentModel = platform.readModelFromDatabase(null);
 
                 platform.getSqlBuilder().alterDatabase(currentModel, model, params, _doDrops,
true);
             }



Mime
View raw message