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 2005/09/27 23:03:01 UTC
svn commit: r292045 [2/5] - in /db/ddlutils/trunk: ./ lib/ lib/build-only/
src/check/ src/doc/src/documentation/
src/doc/src/documentation/content/xdocs/ src/java/org/apache/ddlutils/
src/java/org/apache/ddlutils/builder/ src/java/org/apache/ddlutils/d...
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformUtils.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformUtils.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformUtils.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/PlatformUtils.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,88 +44,88 @@
/**
* Utility functions for dealing with database platforms.
*
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author Thomas Dudziak
* @version $Revision: 279421 $
*/
public class PlatformUtils
{
// Extended drivers that support more than one database
- /** The DataDirect Connect DB2 jdbc driver */
+ /** The DataDirect Connect DB2 jdbc driver. */
public static final String JDBC_DRIVER_DATADIRECT_DB2 = "com.ddtek.jdbc.db2.DB2Driver";
- /** The DataDirect Connect SQLServer jdbc driver */
+ /** The DataDirect Connect SQLServer jdbc driver. */
public static final String JDBC_DRIVER_DATADIRECT_SQLSERVER = "com.ddtek.jdbc.sqlserver.SQLServerDriver";
- /** The DataDirect Connect Oracle jdbc driver */
+ /** The DataDirect Connect Oracle jdbc driver. */
public static final String JDBC_DRIVER_DATADIRECT_ORACLE = "com.ddtek.jdbc.oracle.OracleDriver";
- /** The DataDirect Connect Sybase jdbc driver */
+ /** The DataDirect Connect Sybase jdbc driver. */
public static final String JDBC_DRIVER_DATADIRECT_SYBASE = "com.ddtek.jdbc.sybase.SybaseDriver";
- /** The i-net DB2 jdbc driver */
+ /** The i-net DB2 jdbc driver. */
public static final String JDBC_DRIVER_INET_DB2 = "com.inet.drda.DRDADriver";
- /** The i-net Oracle jdbc driver */
+ /** The i-net Oracle jdbc driver. */
public static final String JDBC_DRIVER_INET_ORACLE = "com.inet.ora.OraDriver";
- /** The i-net SQLServer jdbc driver */
+ /** The i-net SQLServer jdbc driver. */
public static final String JDBC_DRIVER_INET_SQLSERVER = "com.inet.tds.TdsDriver";
- /** The i-net Sybase jdbc driver */
+ /** The i-net Sybase jdbc driver. */
public static final String JDBC_DRIVER_INET_SYBASE = "com.inet.syb.SybDriver";
- /** The i-net pooled jdbc driver for SQLServer and Sybase */
+ /** The i-net pooled jdbc driver for SQLServer and Sybase. */
public static final String JDBC_DRIVER_INET_POOLED = "com.inet.pool.PoolDriver";
- /** The JNetDirect SQLServer jdbc driver */
+ /** The JNetDirect SQLServer jdbc driver. */
public static final String JDBC_DRIVER_JSQLCONNECT_SQLSERVER = "com.jnetdirect.jsql.JSQLDriver";
- /** The jTDS jdbc driver for SQLServer and Sybase */
+ /** The jTDS jdbc driver for SQLServer and Sybase. */
public static final String JDBC_DRIVER_JTDS = "net.sourceforge.jtds.jdbc.Driver";
- /** The subprotocol used by the DataDirect DB2 driver */
+ /** The subprotocol used by the DataDirect DB2 driver. */
public static final String JDBC_SUBPROTOCOL_DATADIRECT_DB2 = "datadirect:db2";
- /** The subprotocol used by the DataDirect SQLServer driver */
+ /** The subprotocol used by the DataDirect SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_DATADIRECT_SQLSERVER = "datadirect:sqlserver";
- /** The subprotocol used by the DataDirect Oracle driver */
+ /** The subprotocol used by the DataDirect Oracle driver. */
public static final String JDBC_SUBPROTOCOL_DATADIRECT_ORACLE = "datadirect:oracle";
- /** The subprotocol used by the DataDirect Sybase driver */
+ /** The subprotocol used by the DataDirect Sybase driver. */
public static final String JDBC_SUBPROTOCOL_DATADIRECT_SYBASE = "datadirect:sybase";
- /** The subprotocol used by the i-net DB2 driver */
+ /** The subprotocol used by the i-net DB2 driver. */
public static final String JDBC_SUBPROTOCOL_INET_DB2 = "inetdb2";
- /** The subprotocol used by the i-net Oracle driver */
+ /** The subprotocol used by the i-net Oracle driver. */
public static final String JDBC_SUBPROTOCOL_INET_ORACLE = "inetora";
- /** A subprotocol used by the i-net SQLServer driver */
+ /** A subprotocol used by the i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER = "inetdae";
- /** A subprotocol used by the i-net SQLServer driver */
+ /** A subprotocol used by the i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER6 = "inetdae6";
- /** A subprotocol used by the i-net SQLServer driver */
+ /** A subprotocol used by the i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7 = "inetdae7";
- /** A subprotocol used by the i-net SQLServer driver */
+ /** A subprotocol used by the i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7A = "inetdae7a";
- /** A subprotocol used by the pooled i-net SQLServer driver */
+ /** A subprotocol used by the pooled i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER_POOLED_1 = "inetpool:inetdae";
- /** A subprotocol used by the pooled i-net SQLServer driver */
+ /** A subprotocol used by the pooled i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER6_POOLED_1 = "inetpool:inetdae6";
- /** A subprotocol used by the pooled i-net SQLServer driver */
+ /** A subprotocol used by the pooled i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7_POOLED_1 = "inetpool:inetdae7";
- /** A subprotocol used by the pooled i-net SQLServer driver */
+ /** A subprotocol used by the pooled i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7A_POOLED_1 = "inetpool:inetdae7a";
- /** A subprotocol used by the pooled i-net SQLServer driver */
+ /** A subprotocol used by the pooled i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER_POOLED_2 = "inetpool:jdbc:inetdae";
- /** A subprotocol used by the pooled i-net SQLServer driver */
+ /** A subprotocol used by the pooled i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER6_POOLED_2 = "inetpool:jdbc:inetdae6";
- /** A subprotocol used by the pooled i-net SQLServer driver */
+ /** A subprotocol used by the pooled i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7_POOLED_2 = "inetpool:jdbc:inetdae7";
- /** A subprotocol used by the pooled i-net SQLServer driver */
+ /** A subprotocol used by the pooled i-net SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_INET_SQLSERVER7A_POOLED_2 = "inetpool:jdbc:inetdae7a";
- /** The subprotocol used by the i-net Sybase driver */
+ /** The subprotocol used by the i-net Sybase driver. */
public static final String JDBC_SUBPROTOCOL_INET_SYBASE = "inetsyb";
- /** The subprotocol used by the pooled i-net Sybase driver */
+ /** The subprotocol used by the pooled i-net Sybase driver. */
public static final String JDBC_SUBPROTOCOL_INET_SYBASE_POOLED_1 = "inetpool:inetsyb";
- /** The subprotocol used by the pooled i-net Sybase driver */
+ /** The subprotocol used by the pooled i-net Sybase driver. */
public static final String JDBC_SUBPROTOCOL_INET_SYBASE_POOLED_2 = "inetpool:jdbc:inetsyb";
- /** The subprotocol used by the JNetDirect SQLServer driver */
+ /** The subprotocol used by the JNetDirect SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_JSQLCONNECT_SQLSERVER = "JSQLConnect";
- /** The subprotocol used by the jTDS SQLServer driver */
+ /** The subprotocol used by the jTDS SQLServer driver. */
public static final String JDBC_SUBPROTOCOL_JTDS_SQLSERVER = "jtds:sqlserver";
- /** The subprotocol used by the jTDS Sybase driver */
+ /** The subprotocol used by the jTDS Sybase driver. */
public static final String JDBC_SUBPROTOCOL_JTDS_SYBASE = "jtds:sybase";
- /** Maps the sub-protocl part of a jdbc connection url to a OJB platform name */
+ /** Maps the sub-protocl part of a jdbc connection url to a OJB platform name. */
private HashMap jdbcSubProtocolToPlatform = new HashMap();
- /** Maps the jdbc driver name to a OJB platform name */
+ /** Maps the jdbc driver name to a OJB platform name. */
private HashMap jdbcDriverToPlatform = new HashMap();
/**
@@ -251,7 +251,7 @@
/**
* Tries to determine the database type for the given jdbc driver and connection url.
*
- * @param driverClassName The fully qualified name of the JDBC driver
+ * @param driverName The fully qualified name of the JDBC driver
* @param jdbcConnectionUrl The connection url
* @return The database type or <code>null</code> if the database type couldn't be determined
*/
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/AxionBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/AxionBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/AxionBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/AxionBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,8 +24,8 @@
/**
* The SQL Builder for the Axion database.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class AxionBuilder extends SqlBuilder
@@ -40,8 +40,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropTable(Table)
+ /**
+ * {@inheritDoc}
*/
public void dropTable(Table table) throws IOException
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/CloudscapeBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/CloudscapeBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/CloudscapeBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/CloudscapeBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
/**
* The SQL Builder for Cloudscape.
*
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class CloudscapeBuilder extends SqlBuilder
@@ -41,8 +41,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getSqlType(org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected String getSqlType(Column column)
{
@@ -69,8 +69,8 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#writeColumnAutoIncrementStmt(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/Db2Builder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/Db2Builder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/Db2Builder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/Db2Builder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,8 +26,8 @@
/**
* The SQL Builder for DB2.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class Db2Builder extends SqlBuilder
@@ -42,8 +42,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getSqlType(org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected String getSqlType(Column column)
{
@@ -70,6 +70,9 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
{
print("GENERATED BY DEFAULT AS IDENTITY");
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/DerbyBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/DerbyBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/DerbyBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/DerbyBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,5 +1,21 @@
package org.apache.ddlutils.builder;
+/*
+ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
import java.io.IOException;
import org.apache.ddlutils.PlatformInfo;
@@ -9,7 +25,7 @@
/**
* The SQL Builder for Derby.
*
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author Thomas Dudziak
* @version $Revision: 279413 $
*/
public class DerbyBuilder extends CloudscapeBuilder
@@ -24,13 +40,11 @@
super(info);
}
-
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#writeColumnAutoIncrementStmt(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
{
print("GENERATED BY DEFAULT AS IDENTITY");
}
-
}
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/HsqlDbBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/HsqlDbBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/HsqlDbBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/HsqlDbBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,8 +24,8 @@
/**
* The SQL Builder for the HsqlDb database.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class HsqlDbBuilder extends SqlBuilder
@@ -40,8 +40,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropTable(Table)
+ /**
+ * {@inheritDoc}
*/
public void dropTable(Table table) throws IOException
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/InterbaseBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/InterbaseBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/InterbaseBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/InterbaseBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
/**
* The SQL Builder for the Interbase database.
*
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author Thomas Dudziak
* @version $Revision: 231306 $
*/
public class InterbaseBuilder extends SqlBuilder
@@ -43,8 +43,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#writeExternalForeignKeyCreateStmt(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.ForeignKey)
+ /**
+ * {@inheritDoc}
*/
protected void writeExternalForeignKeyCreateStmt(Database database, Table table, ForeignKey key) throws IOException
{
@@ -56,8 +56,8 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#writeExternalForeignKeyDropStmt(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.ForeignKey)
+ /**
+ * {@inheritDoc}
*/
protected void writeExternalForeignKeyDropStmt(Table table, ForeignKey foreignKey) throws IOException
{
@@ -66,8 +66,8 @@
printEndOfStatement();
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#createTable(org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void createTable(Database database, Table table) throws IOException
{
@@ -110,8 +110,8 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getSqlType(org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected String getSqlType(Column column)
{
@@ -125,8 +125,8 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropTable(org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void dropTable(Table table) throws IOException
{
@@ -146,8 +146,8 @@
printEndOfStatement();
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#printAutoIncrementColumn(Table,Column)
+ /**
+ * {@inheritDoc}
*/
protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MSSqlBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MSSqlBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MSSqlBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MSSqlBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,8 +29,8 @@
/**
* The SQL Builder for the Microsoft SQL Server.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class MSSqlBuilder extends SqlBuilder
@@ -45,8 +45,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#createTable(org.apache.ddlutils.model.Database, org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void createTable(Database database, Table table) throws IOException
{
@@ -54,8 +54,8 @@
super.createTable(database, table);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#alterTable(org.apache.ddlutils.model.Database, org.apache.ddlutils.model.Table, org.apache.ddlutils.model.Database, org.apache.ddlutils.model.Table, boolean, boolean)
+ /**
+ * {@inheritDoc}
*/
protected void alterTable(Database currentModel, Table currentTable, Database desiredModel, Table desiredTable, boolean doDrops, boolean modifyColumns) throws IOException
{
@@ -63,8 +63,8 @@
super.alterTable(currentModel, currentTable, desiredModel, desiredTable, doDrops, modifyColumns);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropTable(org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void dropTable(Table table) throws IOException
{
@@ -102,8 +102,8 @@
printEndOfStatement();
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropExternalForeignKeys(org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void dropExternalForeignKeys(Table table) throws IOException
{
@@ -111,16 +111,16 @@
super.dropExternalForeignKeys(table);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#writeColumnAutoIncrementStmt(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
{
print("IDENTITY (1,1) ");
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#shouldGeneratePrimaryKeys(org.apache.ddlutils.model.Column[])
+ /**
+ * {@inheritDoc}
*/
protected boolean shouldGeneratePrimaryKeys(Column[] primaryKeyColumns)
{
@@ -131,8 +131,8 @@
return primaryKeyColumns.length > 0;
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#writeExternalIndexDropStmt(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.Index)
+ /**
+ * {@inheritDoc}
*/
public void writeExternalIndexDropStmt(Table table, Index index) throws IOException
{
@@ -143,8 +143,8 @@
printEndOfStatement();
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#writeColumnAlterStmt(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.Column, boolean)
+ /**
+ * {@inheritDoc}
*/
public void writeColumnAlterStmt(Table table, Column column, boolean isNewColumn) throws IOException
{
@@ -154,16 +154,16 @@
printEndOfStatement();
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropExternalForeignKey(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.ForeignKey, int)
+ /**
+ * {@inheritDoc}
*/
- protected void writeExternalForeignKeyDropStmt(Table table, ForeignKey foreignKey, int numKey) throws IOException
+ protected void writeExternalForeignKeyDropStmt(Table table, ForeignKey foreignKey) throws IOException
{
- String constraintName = getConstraintName(null, table, "FK", Integer.toString(numKey));
+ String constraintName = foreignKey.getName() == null ? getConstraintName(null, table, "FK", getForeignKeyName(foreignKey)) : foreignKey.getName();
- print("IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name=");
+ print("IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'RI' AND name = ");
printIdentifier(constraintName);
- println();
+ println(")");
printIndent();
print("ALTER TABLE ");
printIdentifier(getTableName(table));
@@ -184,24 +184,24 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getDeleteSql(org.apache.ddlutils.model.Table, java.util.HashMap, boolean)
+ /**
+ * {@inheritDoc}
*/
public String getDeleteSql(Table table, HashMap pkValues, boolean genPlaceholders)
{
return getQuotationOnStatement() + super.getDeleteSql(table, pkValues, genPlaceholders);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getInsertSql(org.apache.ddlutils.model.Table, java.util.HashMap, boolean)
+ /**
+ * {@inheritDoc}
*/
public String getInsertSql(Table table, HashMap columnValues, boolean genPlaceholders)
{
return getQuotationOnStatement() + super.getInsertSql(table, columnValues, genPlaceholders);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getUpdateSql(org.apache.ddlutils.model.Table, java.util.HashMap, boolean)
+ /**
+ * {@inheritDoc}
*/
public String getUpdateSql(Table table, HashMap columnValues, boolean genPlaceholders)
{
@@ -209,7 +209,9 @@
}
/**
- * Writes the statement that turns on the ability to write delimited identifiers.
+ * Returns the statement that turns on the ability to write delimited identifiers.
+ *
+ * @return The quotation-on statement
*/
private String getQuotationOnStatement()
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MckoiBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MckoiBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MckoiBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MckoiBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,8 +25,8 @@
/**
* The SQL Builder for the Mckoi database.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class MckoiBuilder extends SqlBuilder
@@ -41,6 +41,9 @@
super(info);
}
+ /**
+ * {@inheritDoc}
+ */
public void dropTable(Table table) throws IOException
{
print("DROP TABLE IF EXISTS ");
@@ -48,6 +51,9 @@
printEndOfStatement();
}
+ /**
+ * {@inheritDoc}
+ */
protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
{
// we start at value 1 to avoid issues with jdbc
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MySqlBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MySqlBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MySqlBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/MySqlBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,9 +26,9 @@
/**
* The SQL Builder for MySQL.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
+ * @author James Strachan
* @author John Marshall/Connectria
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class MySqlBuilder extends SqlBuilder
@@ -43,8 +43,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropTable(Table)
+ /**
+ * {@inheritDoc}
*/
public void dropTable(Table table) throws IOException
{
@@ -53,8 +53,8 @@
printEndOfStatement();
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getSqlType(org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected String getSqlType(Column column)
{
@@ -81,33 +81,29 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#printAutoIncrementColumn(Table,Column)
+ /**
+ * {@inheritDoc}
*/
protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
{
print("AUTO_INCREMENT");
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#shouldGeneratePrimaryKeys(org.apache.ddlutils.model.Column[])
+ /**
+ * {@inheritDoc}
*/
protected boolean shouldGeneratePrimaryKeys(Column[] primaryKeyColumns)
{
- /*
- * mySQL requires primary key indication for autoincrement key columns
- * I'm not sure why the default skips the pk statement if all are identity
- */
+ // mySQL requires primary key indication for autoincrement key columns
+ // I'm not sure why the default skips the pk statement if all are identity
return true;
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getSelectLastInsertId(org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public String getSelectLastInsertId(Table table)
{
return "SELECT LAST_INSERT_ID()";
}
-
-
}
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/OracleBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/OracleBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/OracleBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/OracleBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,8 +27,8 @@
/**
* The SQL Builder for Oracle.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class OracleBuilder extends SqlBuilder
@@ -43,8 +43,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropTable(org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void dropTable(Table table) throws IOException
{
@@ -66,16 +66,16 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropExternalForeignKeys(org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void dropExternalForeignKeys(Table table) throws IOException
{
// no need to as we drop the table with CASCASE CONSTRAINTS
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#createTable(org.apache.ddlutils.model.Database, org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void createTable(Database database, Table table) throws IOException
{
@@ -109,8 +109,8 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getSqlType(org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected String getSqlType(Column column)
{
@@ -138,8 +138,8 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#writeColumnAutoIncrementStmt(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/PostgreSqlBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/PostgreSqlBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/PostgreSqlBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/PostgreSqlBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,8 +26,8 @@
/**
* The SQL Builder for PostgresSql.
*
- * @author <a href="mailto:john@zenplex.com">John Thorhauer</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author John Thorhauer
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class PostgreSqlBuilder extends SqlBuilder
@@ -42,8 +42,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropTable(Table)
+ /**
+ * {@inheritDoc}
*/
public void dropTable(Table table) throws IOException
{
@@ -62,8 +62,8 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#createTable(org.apache.ddlutils.model.Database, org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void createTable(Database database, Table table) throws IOException
{
@@ -92,8 +92,8 @@
printEndOfStatement();
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#writeColumnAutoIncrementStmt(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
{
@@ -102,8 +102,8 @@
print(")");
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getSelectLastInsertId(org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public String getSelectLastInsertId(Table table)
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SapDbBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SapDbBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SapDbBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SapDbBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,8 +25,8 @@
/**
* The SQL Builder for SapDB.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class SapDbBuilder extends SqlBuilder
@@ -41,8 +41,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropTable(Table)
+ /**
+ * {@inheritDoc}
*/
public void dropTable(Table table) throws IOException
{
@@ -52,8 +52,8 @@
printEndOfStatement();
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#writeColumnAutoIncrementStmt(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.Column)
+ /**
+ * {@inheritDoc}
*/
protected void writeColumnAutoIncrementStmt(Table table, Column column) throws IOException
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SqlBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SqlBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SqlBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SqlBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,38 +50,38 @@
*
* TODO: It might be useful to add foreignkey analysis for creation/dropping of tables
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
+ * @author James Strachan
* @author John Marshall/Connectria
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author Thomas Dudziak
* @version $Revision$
*/
public abstract class SqlBuilder
{
-
+ /** The line separator for in between sql commands. */
private static final String LINE_SEPERATOR = System.getProperty("line.separator", "\n");
/** The Log to which logging calls will be made. */
protected final Log _log = LogFactory.getLog(SqlBuilder.class);
- /** The current Writer used to output the SQL to */
+ /** The current Writer used to output the SQL to. */
private Writer _writer;
- /** The indentation used to indent commands */
+ /** The indentation used to indent commands. */
private String _indent = " ";
- /** The platform info */
+ /** The platform info. */
private PlatformInfo _info;
- /** An optional locale specification for number and date formatting */
+ /** An optional locale specification for number and date formatting. */
private String _valueLocale;
- /** The date formatter */
+ /** The date formatter. */
private DateFormat _valueDateFormat;
- /** The date time formatter */
+ /** The date time formatter. */
private DateFormat _valueTimeFormat;
- /** The number formatter */
+ /** The number formatter. */
private NumberFormat _valueNumberFormat;
//
@@ -131,7 +131,7 @@
/**
* Returns the string used to indent the SQL.
*
- * @param The indentation string
+ * @return The indentation string
*/
public String getIndent()
{
@@ -165,8 +165,8 @@
* (when printing default values and in generates insert/update/delete
* statements).
*
- * @param locale The new locale or <code>null</code> if default formatting
- * should be used; Format is "language[_country[_variant]]"
+ * @param localeStr The new locale or <code>null</code> if default formatting
+ * should be used; Format is "language[_country[_variant]]"
*/
public void setValueLocale(String localeStr)
{
@@ -381,8 +381,8 @@
if (_log.isInfoEnabled())
{
_log.info("Altering column " + desiredTable.getName() + "." + desiredColumn.getName());
- _log.info(" desired = " + desiredColumn.toStringAll());
- _log.info(" current = " + currentColumn.toStringAll());
+ _log.info(" desired = " + desiredColumn.toVerboseString());
+ _log.info(" current = " + currentColumn.toVerboseString());
}
writeColumnAlterStmt(desiredTable, desiredColumn, false);
}
@@ -1057,7 +1057,7 @@
}
/**
- * Returns the database-native type for the given column
+ * Returns the database-native type for the given column.
*
* @param column The column
* @return The native type
@@ -1152,7 +1152,7 @@
}
/**
- * Prints that a column is nullable
+ * Prints that a column is nullable.
*/
protected void writeColumnNullableStmt() throws IOException
{
@@ -1160,7 +1160,7 @@
}
/**
- * Prints that a column is not nullable
+ * Prints that a column is not nullable.
*/
protected void writeColumnNotNullableStmt() throws IOException
{
@@ -1491,7 +1491,6 @@
* @param database The database model
* @param table The table
* @param key The foreign key
- * @param numKey The number of the key, starting with 1
*/
protected void writeExternalForeignKeyCreateStmt(Database database, Table table, ForeignKey key) throws IOException
{
@@ -1552,11 +1551,10 @@
/**
* Generates the statement to drop a foreignkey constraint from the database using an
- * alter table statement-
+ * alter table statement.
*
- * @param table The table
- * @param key The foreign key
- * @param numKey The number of the key, starting with 1
+ * @param table The table
+ * @param foreignKey The foreign key
*/
protected void writeExternalForeignKeyDropStmt(Table table, ForeignKey foreignKey) throws IOException
{
@@ -1670,7 +1668,7 @@
}
/**
- * Prints the characters used to indent SQL
+ * Prints the characters used to indent SQL.
*/
protected void printIndent() throws IOException
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SybaseBuilder.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SybaseBuilder.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SybaseBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/SybaseBuilder.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.builder;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,10 +25,10 @@
import org.apache.ddlutils.model.Table;
/**
- * The SQL Builder for Sybase
+ * The SQL Builder for Sybase.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class SybaseBuilder extends SqlBuilder
@@ -43,8 +43,8 @@
super(info);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#createTable(org.apache.ddlutils.model.Database, org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void createTable(Database database, Table table) throws IOException
{
@@ -52,8 +52,8 @@
super.createTable(database, table);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#alterTable(org.apache.ddlutils.model.Database, org.apache.ddlutils.model.Table, org.apache.ddlutils.model.Database, org.apache.ddlutils.model.Table, boolean, boolean)
+ /**
+ * {@inheritDoc}
*/
protected void alterTable(Database currentModel, Table currentTable, Database desiredModel, Table desiredTable, boolean doDrops, boolean modifyColumns) throws IOException
{
@@ -61,8 +61,8 @@
super.alterTable(currentModel, currentTable, desiredModel, desiredTable, doDrops, modifyColumns);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropTable(org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void dropTable(Table table) throws IOException
{
@@ -78,14 +78,14 @@
printEndOfStatement();
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropExternalForeignKey(org.apache.ddlutils.model.Table, org.apache.ddlutils.model.ForeignKey, int)
+ /**
+ * {@inheritDoc}
*/
- protected void writeExternalForeignKeyDropStmt(Table table, ForeignKey foreignKey, int numKey) throws IOException
+ protected void writeExternalForeignKeyDropStmt(Table table, ForeignKey foreignKey) throws IOException
{
- String constraintName = getConstraintName(null, table, "FK", Integer.toString(numKey));
+ String constraintName = foreignKey.getName() == null ? getConstraintName(null, table, "FK", getForeignKeyName(foreignKey)) : foreignKey.getName();
- print("IF EXISTS (SELECT 1 FROM sysobjects WHERE type ='RI' AND name = ");
+ print("IF EXISTS (SELECT 1 FROM sysobjects WHERE type = 'RI' AND name = ");
printIdentifier(constraintName);
println(")");
printIndent();
@@ -96,8 +96,8 @@
printEndOfStatement();
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#dropExternalForeignKeys(org.apache.ddlutils.model.Table)
+ /**
+ * {@inheritDoc}
*/
public void dropExternalForeignKeys(Table table) throws IOException
{
@@ -117,24 +117,24 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getDeleteSql(org.apache.ddlutils.model.Table, java.util.HashMap, boolean)
+ /**
+ * {@inheritDoc}
*/
public String getDeleteSql(Table table, HashMap pkValues, boolean genPlaceholders)
{
return getQuotationOnStatement() + super.getDeleteSql(table, pkValues, genPlaceholders);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getInsertSql(org.apache.ddlutils.model.Table, java.util.HashMap, boolean)
+ /**
+ * {@inheritDoc}
*/
public String getInsertSql(Table table, HashMap columnValues, boolean genPlaceholders)
{
return getQuotationOnStatement() + super.getInsertSql(table, columnValues, genPlaceholders);
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.builder.SqlBuilder#getUpdateSql(org.apache.ddlutils.model.Table, java.util.HashMap, boolean)
+ /**
+ * {@inheritDoc}
*/
public String getUpdateSql(Table table, HashMap columnValues, boolean genPlaceholders)
{
@@ -142,7 +142,9 @@
}
/**
- * Writes the statement that turns on the ability to write delimited identifiers.
+ * Returns the statement that turns on the ability to write delimited identifiers.
+ *
+ * @return The quotation-on statement
*/
private String getQuotationOnStatement()
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/package.html
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/package.html?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/package.html (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/builder/package.html Tue Sep 27 13:55:42 2005
@@ -1,9 +1,29 @@
<html>
<head>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Thomas Dudziak">
</head>
-<body>
+<body bgcolor="white">
<p>
- This package contains classes to generate DDL and SQL for different database implementations.
+ This package contains classes to generate SQL statements for the different database platforms.
+ Usually you shouldn't need to use these classes directly. Rather, get a
+ {@link org.apache.ddlutils.Platform} instance for your database and then get the associated
+ builder from this instance via the {@link org.apache.ddlutils.Platform#getSqlBuilder()} method.
</p>
</body>
</html>
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/DynaClassCache.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/DynaClassCache.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/DynaClassCache.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/DynaClassCache.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.dynabean;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,13 +30,13 @@
* Provides a cache of dyna class instances for a specific model, as well as
* helper methods for dealing with these classes.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision: 231110 $
*/
public class DynaClassCache
{
- /** A cache of the SqlDynaClasses per table name */
+ /** A cache of the SqlDynaClasses per table name. */
private Map _dynaClassCache = new HashMap();
/**
@@ -118,6 +118,7 @@
/**
* Returns the {@link SqlDynaClass} for the given bean.
*
+ * @param dynaBean The bean
* @return The dyna bean class
*/
public SqlDynaClass getDynaClass(DynaBean dynaBean) throws DynaSqlException
@@ -139,6 +140,7 @@
* Creates a new {@link SqlDynaClass} instance for the given table based on the table definition.
*
* @param table The table
+ * @return The new dyna class
*/
private SqlDynaClass createDynaClass(Table table)
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/DynaSqlIterator.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/DynaSqlIterator.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/DynaSqlIterator.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/DynaSqlIterator.java Tue Sep 27 13:55:42 2005
@@ -1,5 +1,21 @@
package org.apache.ddlutils.dynabean;
+/*
+ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
@@ -27,20 +43,23 @@
* If the query is against a known table, then {@link org.apache.ddlutils.dynabean.SqlDynaBean} instances
* are created from the rows, otherwise normal {@link org.apache.commons.beanutils.DynaBean} instances
* are created.
+ *
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public class DynaSqlIterator implements Iterator
{
- /** The base result set */
+ /** The base result set. */
private ResultSet _resultSet;
- /** The dyna class to use for creating beans */
+ /** The dyna class to use for creating beans. */
private DynaClass _dynaClass;
- /** Maps column names to properties */
+ /** Maps column names to properties. */
private Map _columnsToProperties = new ListOrderedMap();
- /** Whether the next call to hasNext or next needs advancement */
+ /** Whether the next call to hasNext or next needs advancement. */
private boolean _needsAdvancing = true;
- /** Whether we're already at the end of the result set */
+ /** Whether we're already at the end of the result set. */
private boolean _isAtEnd = false;
- /** Whether to close the statement and connection after finishing */
+ /** Whether to close the statement and connection after finishing. */
private boolean _cleanUpAfterFinish;
/**
@@ -154,7 +173,8 @@
* Prepares the query hints by extracting the column names and using them as keys
* into the resulting map pointing to the corresponding table.
*
- * @param queryHints The query hints
+ * @param queryHints The query hints
+ * @param caseSensitive Whether the case of the column names is important
* @return The column name -> table map
*/
private Map prepareQueryHints(Table[] queryHints, boolean caseSensitive)
@@ -180,8 +200,8 @@
return result;
}
- /* (non-Javadoc)
- * @see java.util.Iterator#hasNext()
+ /**
+ * {@inheritDoc}
*/
public boolean hasNext() throws DynaSqlException
{
@@ -189,8 +209,8 @@
return !_isAtEnd;
}
- /* (non-Javadoc)
- * @see java.util.Iterator#next()
+ /**
+ * {@inheritDoc}
*/
public Object next() throws DynaSqlException
{
@@ -246,8 +266,8 @@
}
}
- /* (non-Javadoc)
- * @see java.util.Iterator#remove()
+ /**
+ * {@inheritDoc}
*/
public void remove() throws DynaSqlException
{
@@ -286,8 +306,8 @@
}
}
- /* (non-Javadoc)
- * @see java.lang.Object#finalize()
+ /**
+ * {@inheritDoc}
*/
protected void finalize() throws Throwable
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaBean.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaBean.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaBean.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaBean.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.dynabean;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,13 +24,13 @@
* SqlDynaBean is a DynaBean which can be persisted as a single row in
* a Database Table.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class SqlDynaBean extends BasicDynaBean
{
- /** Unique ID for serializaion purposes */
+ /** Unique ID for serializaion purposes. */
private static final long serialVersionUID = -6946514447446174227L;
/**
@@ -43,8 +43,8 @@
super(dynaClass);
}
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
+ /**
+ * {@inheritDoc}
*/
public String toString()
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaClass.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaClass.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaClass.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaClass.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.dynabean;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,20 +27,20 @@
* SqlDynaClass is a DynaClass which is associated with a persistent
* Table in a Database.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class SqlDynaClass extends BasicDynaClass
{
- /** Unique ID for serializaion purposes */
+ /** Unique ID for serializaion purposes. */
private static final long serialVersionUID = -5768155698352911245L;
- /** The table for which this dyna class is defined */
+ /** The table for which this dyna class is defined. */
private Table _table;
- /** The primary key dyna properties */
+ /** The primary key dyna properties. */
private SqlDynaProperty[] _primaryKeyProperties;
- /** The non-primary key dyna properties */
+ /** The non-primary key dyna properties. */
private SqlDynaProperty[] _nonPrimaryKeyProperties;
/**
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaProperty.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaProperty.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaProperty.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/dynabean/SqlDynaProperty.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.dynabean;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,16 +25,16 @@
* for the property such as whether the property is a primary key column,
* an autoIncrement column and the SQL type etc.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author James Strachan
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class SqlDynaProperty extends DynaProperty
{
- /** Unique ID for serializaion purposes */
+ /** Unique ID for serializaion purposes. */
private static final long serialVersionUID = -4491018827449106588L;
- /** The column for which this dyna property is defined */
+ /** The column for which this dyna property is defined. */
private Column _column;
/**
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataConverterRegistration.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataConverterRegistration.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataConverterRegistration.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataConverterRegistration.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.io;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,24 +16,25 @@
* limitations under the License.
*/
-import java.sql.Types;
-
import org.apache.ddlutils.io.converters.SqlTypeConverter;
import org.apache.ddlutils.model.TypeMap;
import org.apache.tools.ant.BuildException;
/**
* Represents the registration of a data converter for tasks that work on data files.
+ *
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public class DataConverterRegistration
{
- /** The converter */
+ /** The converter. */
private SqlTypeConverter _converter;
- /** The sql type for which the converter shall be registered */
+ /** The sql type for which the converter shall be registered. */
private int _typeCode = Integer.MIN_VALUE;
- /** The table name */
+ /** The table name. */
private String _table;
- /** The column name */
+ /** The column name. */
private String _column;
/**
@@ -80,10 +81,15 @@
*/
public void setJdbcType(String jdbcTypeName) throws BuildException
{
- _typeCode = TypeMap.getJdbcTypeCode(jdbcTypeName);
- if ((_typeCode == Types.OTHER) && !TypeMap.OTHER.equalsIgnoreCase(jdbcTypeName))
+ Integer typeCode = TypeMap.getJdbcTypeCode(jdbcTypeName);
+
+ if (typeCode == null)
{
throw new BuildException("Unknown jdbc type "+jdbcTypeName);
+ }
+ else
+ {
+ _typeCode = typeCode.intValue();
}
}
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataDtdWriter.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataDtdWriter.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataDtdWriter.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataDtdWriter.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.io;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,8 +29,8 @@
*
* TODO: Make names (tables, columns) XML-compliant
*
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
- * @version $Revision:$
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public class DataDtdWriter
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataReader.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataReader.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataReader.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataReader.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.io;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,22 +33,22 @@
/**
* Reads data XML into dyna beans matching a specified database model.
*
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
- * @version $Revision:$
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public class DataReader extends Digester
{
- /** The database model */
+ /** The database model. */
private Database _model;
- /** The object to receive the read beans */
+ /** The object to receive the read beans. */
private DataSink _sink;
- /** Specifies whether the (lazy) configuration of the digester still needs to be performed */
+ /** Specifies whether the (lazy) configuration of the digester still needs to be performed. */
private boolean _needsConfiguration = true;
- /** The converters per type */
+ /** The converters per type. */
private HashMap _convertersPerType = new HashMap();
- /** The converters per table-column path */
+ /** The converters per table-column path. */
private HashMap _convertersPerPath = new HashMap();
- /** Whether to be case sensitive or not */
+ /** Whether to be case sensitive or not. */
private boolean _caseSensitive = false;
/**
@@ -179,8 +179,8 @@
_caseSensitive = beCaseSensitive;
}
- /* (non-Javadoc)
- * @see org.apache.commons.digester.Digester#configure()
+ /**
+ * {@inheritDoc}
*/
protected void configure()
{
@@ -220,8 +220,8 @@
super.configure();
}
- /* (non-Javadoc)
- * @see org.apache.commons.digester.Digester#endDocument()
+ /**
+ * {@inheritDoc}
*/
public void endDocument() throws SAXException
{
@@ -229,8 +229,8 @@
_sink.end();
}
- /* (non-Javadoc)
- * @see org.apache.commons.digester.Digester#startDocument()
+ /**
+ * {@inheritDoc}
*/
public void startDocument() throws SAXException
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataSink.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataSink.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataSink.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataSink.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.io;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,8 +21,8 @@
/**
* Marks classes that can receive dyna beans read by the {@link org.apache.ddlutils.io.DataReader}.
*
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
- * @version $Revision:$
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public interface DataSink
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataSinkException.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataSinkException.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataSinkException.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataSinkException.java Tue Sep 27 13:55:42 2005
@@ -1,12 +1,34 @@
package org.apache.ddlutils.io;
+/*
+ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
import org.apache.commons.lang.exception.NestableRuntimeException;
/**
* Exception generated by {@link org.apache.ddlutils.io.DataSink} implementations.
+ *
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public class DataSinkException extends NestableRuntimeException
{
+ /** Unique id for serialization purposes. */
+ private static final long serialVersionUID = 6790909409839782437L;
+
/**
* Creates a new exception object.
*/
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataToDatabaseSink.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.io;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,25 +39,28 @@
* Data sink that directly inserts the beans into the database. If configured, it will make
* sure that the beans are inserted in the correct order according to the foreignkeys. Note
* that this will only work if there are no circles.
+ *
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public class DataToDatabaseSink implements DataSink
{
- /** Our log */
+ /** Our log. */
private final Log _log = LogFactory.getLog(DataToDatabaseSink.class);
- /** Generates the sql and writes it to the database */
+ /** Generates the sql and writes it to the database. */
private Platform _platform;
- /** The database model */
+ /** The database model. */
private Database _model;
- /** The connection to the database */
+ /** The connection to the database. */
private Connection _connection;
- /** Whether to stop when an error has occurred while inserting a bean into the database */
+ /** Whether to stop when an error has occurred while inserting a bean into the database. */
private boolean _haltOnErrors = true;
- /** Whether to delay the insertion of beans so that the beans referenced by it via foreignkeys, are already inserted into the database */
+ /** Whether to delay the insertion of beans so that the beans referenced by it via foreignkeys, are already inserted into the database. */
private boolean _ensureFkOrder = true;
- /** Stores the already-processed identities per table name */
+ /** Stores the already-processed identities per table name. */
private HashMap _processedIdentities = new HashMap();
- /** Stores the objects that are waiting for other objects to be inserted */
+ /** Stores the objects that are waiting for other objects to be inserted. */
private ArrayList _waitingObjects = new ArrayList();
/**
@@ -119,8 +122,8 @@
_ensureFkOrder = ensureFkOrder;
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.io.DataSink#end()
+ /**
+ * {@inheritDoc}
*/
public void end() throws DataSinkException
{
@@ -138,8 +141,8 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.io.DataSink#start()
+ /**
+ * {@inheritDoc}
*/
public void start() throws DataSinkException
{
@@ -171,8 +174,8 @@
}
}
- /* (non-Javadoc)
- * @see org.apache.ddlutils.io.DataSink#addBean(org.apache.commons.beanutils.DynaBean)
+ /**
+ * {@inheritDoc}
*/
public void addBean(DynaBean bean) throws DataSinkException
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataWriter.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataWriter.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataWriter.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DataWriter.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.io;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,17 +33,18 @@
* Writes dyna beans matching a specified database model into an XML file.
*
* TODO: Make names (tables, columns) XML-compliant
+ * TODO: Use converters
*
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
- * @version $Revision:$
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public class DataWriter
{
- /** The database model */
+ /** The database model. */
private Database _model;
- /** The target */
+ /** The target. */
private PrintWriter _output;
- /** The output encoding */
+ /** The output encoding. */
private String _encoding;
/**
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DatabaseIO.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.io;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -37,14 +37,14 @@
/**
* This class provides functions to read and write database models from/to XML.
*
- * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
+ * @author James Strachan
* @author Matthew Hawthorne
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class DatabaseIO
{
- /** Whether to use the internal dtd that comes with commons-sql */
+ /** Whether to use the internal dtd that comes with DdlUtils. */
private boolean _useInternalDtd = true;
/**
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DigesterRules.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DigesterRules.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DigesterRules.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DigesterRules.java Tue Sep 27 13:55:42 2005
@@ -1,5 +1,21 @@
package org.apache.ddlutils.io;
+/*
+ * Copyright 1999-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
import java.util.List;
import org.apache.commons.digester.Rule;
import org.apache.commons.digester.RulesBase;
@@ -7,10 +23,13 @@
/**
* An extended rules implementation that is able to match case-insensitively. Per default,
* the rules are matches disregarding the case.
+ *
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public class DigesterRules extends RulesBase
{
- /** Whether to be case sensitive or not */
+ /** Whether to be case sensitive or not. */
private boolean _caseSensitive = false;
/**
@@ -23,7 +42,6 @@
return _caseSensitive;
}
-
/**
* Specifies whether this rules object shall match case sensitively.
*
@@ -34,17 +52,16 @@
_caseSensitive = beCaseSensitive;
}
- /* (non-Javadoc)
- * @see org.apache.commons.digester.RulesBase#add(java.lang.String, org.apache.commons.digester.Rule)
+ /**
+ * {@inheritDoc}
*/
public void add(String pattern, Rule rule)
{
super.add(_caseSensitive ? pattern : pattern.toLowerCase(), rule);
}
-
- /* (non-Javadoc)
- * @see org.apache.commons.digester.RulesBase#lookup(java.lang.String, java.lang.String)
+ /**
+ * {@inheritDoc}
*/
protected List lookup(String namespaceURI, String pattern)
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DynaSqlCreateRule.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DynaSqlCreateRule.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DynaSqlCreateRule.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/DynaSqlCreateRule.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.io;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,22 +25,22 @@
/**
* A digester rule for creating dyna beans.
*
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
- * @version $Revision:$
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public class DynaSqlCreateRule extends Rule
{
- /** The database model for which we'l be creating beans */
+ /** The database model for which we'l be creating beans. */
private Database _model;
- /** The table that we're creating instances for */
+ /** The table that we're creating instances for. */
private Table _table;
- /** The object that will receive the read beans */
+ /** The object that will receive the read beans. */
private DataSink _receiver;
/**
* Creates a new creation rule that creates dyna bean instances.
*
- * @param dynaSql The dyna sql instance to use for creating the dyna beans
+ * @param model The database model that we're operating on
* @param table The table that we're creating instances for
* @param receiver The object that will receive the read beans
*/
@@ -51,8 +51,8 @@
_receiver = receiver;
}
- /* (non-Javadoc)
- * @see org.apache.commons.digester.Rule#begin(java.lang.String, java.lang.String, org.xml.sax.Attributes)
+ /**
+ * {@inheritDoc}
*/
public void begin(String namespace, String name, Attributes attributes) throws Exception
{
@@ -65,8 +65,8 @@
digester.push(instance);
}
- /* (non-Javadoc)
- * @see org.apache.commons.digester.Rule#end(java.lang.String, java.lang.String)
+ /**
+ * {@inheritDoc}
*/
public void end(String namespace, String name) throws Exception
{
@@ -78,5 +78,4 @@
}
_receiver.addBean(top);
}
-
}
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/Identity.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/Identity.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/Identity.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/Identity.java Tue Sep 27 13:55:42 2005
@@ -1,11 +1,7 @@
package org.apache.ddlutils.io;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,19 +16,25 @@
* limitations under the License.
*/
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
/**
* Stores the identity of an database object as defined by its primary keys. Is used
* by {@link org.apache.ddlutils.io.DataToDatabaseSink} class for inserting objects
* in the correct order.
+ *
+ * @author Thomas Dudziak
+ * @version $Revision: 289996 $
*/
public class Identity
{
- /** The name of the table */
+ /** The name of the table. */
private String _tableName;
- /** The optional foreign key name whose referenced object this identity represents */
+ /** The optional foreign key name whose referenced object this identity represents. */
private String _fkName;
- /** The identity columns and their values */
+ /** The identity columns and their values. */
private HashMap _columnValues = new HashMap();
/**
@@ -80,8 +82,8 @@
_columnValues.put(name, value);
}
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
+ /**
+ * {@inheritDoc}
*/
public boolean equals(Object obj)
{
@@ -124,16 +126,16 @@
return true;
}
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
+ /**
+ * {@inheritDoc}
*/
public int hashCode()
{
return toString().hashCode();
}
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
+ /**
+ * {@inheritDoc}
*/
public String toString()
{
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/JdbcModelReader.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/JdbcModelReader.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/JdbcModelReader.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/JdbcModelReader.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.io;
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,26 +48,26 @@
/**
* An utility class to create a Database model from a live database.
*
- * @author <a href="mailto:drfish@cox.net">J. Russell Smyth</a>
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author J. Russell Smyth
+ * @author Thomas Dudziak
* @version $Revision$
*/
public class JdbcModelReader
{
- /** The Log to which logging calls will be made */
+ /** The Log to which logging calls will be made. */
private final Log log = LogFactory.getLog(JdbcModelReader.class);
- /** Contains default column sizes (minimum sizes that a JDBC-compliant db must support) */
+ /** Contains default column sizes (minimum sizes that a JDBC-compliant db must support). */
private HashMap defaultSizes = new HashMap();
- /** The database connection */
+ /** The database connection. */
private Connection connection = null;
- /** The database catalog to read */
+ /** The database catalog to read. */
private String catalog = "%";
- /** The database schema to read */
+ /** The database schema to read. */
private String schema = "%";
- /** The table types to recognize */
+ /** The table types to recognize. */
private String[] tableTypes = { "TABLE" };
- /** The pattern to recognize when parsing a default value */
+ /** The pattern to recognize when parsing a default value. */
private Pattern defaultPattern = Pattern.compile("\\(\\'?(.*?)\\'?\\)");
/**
Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/io/LocalEntityResolver.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/io/LocalEntityResolver.java?rev=292045&r1=292044&r2=292045&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/io/LocalEntityResolver.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/io/LocalEntityResolver.java Tue Sep 27 13:55:42 2005
@@ -1,7 +1,7 @@
package org.apache.ddlutils.io;
/*
- * Copyright 1999-2002,2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,14 +28,16 @@
* An entity resolver that matches the specific database dtds to the one that comes
* with commons-sql, and that can handle file url's.
*
- * @author <a href="mailto:tomdz@apache.org">Thomas Dudziak</a>
+ * @author Thomas Dudziak
+ * @version $Revision$
*/
public class LocalEntityResolver implements EntityResolver
{
+ /** The default DTD. */
private static final String DTD_PREFIX = "http://db.apache.org/torque/dtd/database";
- /* (non-Javadoc)
- * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String)
+ /**
+ * {@inheritDoc}
*/
public InputSource resolveEntity(String publicId, String systemId) throws SAXException
{