org.enableit.db.darrt
Class DDLFactory

java.lang.Object
  |
  +--org.enableit.db.darrt.DDLFactory

public class DDLFactory
extends java.lang.Object

Utility Singleton for creating Data Definition Language.

Author:
Tim Stephenson

Field Summary
protected static org.apache.log4j.Logger logger
          The Log4J Logger doing the logging.
 
Method Summary
 java.util.List getCreate(org.enableit.db.beans.Provider provider, java.lang.Object dataObject)
          Deprecated. Use getGenerator(provider).getCreate(dataObject).
 org.enableit.db.darrt.DDLGenerator getGenerator(org.enableit.db.beans.Provider provider)
          Returns the appropriate generator for the provider specified.
 org.enableit.db.darrt.DDLGenerator getGenerator(java.lang.String productName)
          Returns the appropriate generator for the provider specified.
static org.enableit.db.darrt.DDLFactory getInstance()
          Factory method.
 java.util.List getModify(org.enableit.db.beans.Provider provider, org.enableit.db.darrt.beans.DiffData diff)
          Deprecated. Use getGenerator(provider).getModify(diff).
 void install(java.sql.Connection conn, org.enableit.db.darrt.beans.DiffData diff)
          Install the necessary changes in the provider database to eliminate the differences in the diffs parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
The Log4J Logger doing the logging.

Method Detail

getInstance

public static org.enableit.db.darrt.DDLFactory getInstance()
Factory method.


getCreate

public java.util.List getCreate(org.enableit.db.beans.Provider provider,
                                java.lang.Object dataObject)
                         throws ConfigurationException
Deprecated. Use getGenerator(provider).getCreate(dataObject).

Create a database object that does not currently exist.

Parameters:
provider -
Returns:
List of DDL statements (String type).
ConfigurationException

getModify

public java.util.List getModify(org.enableit.db.beans.Provider provider,
                                org.enableit.db.darrt.beans.DiffData diff)
                         throws ConfigurationException
Deprecated. Use getGenerator(provider).getModify(diff).

Parameters:
provider -
diff -
Returns:
List of DDL statements (String type).
ConfigurationException

install

public void install(java.sql.Connection conn,
                    org.enableit.db.darrt.beans.DiffData diff)
             throws SchemaHandlingException
Install the necessary changes in the provider database to eliminate the differences in the diffs parameter.

It is critically important that error handling is such that either all changes are applied or none. In the latter case reasons should be provided.

SchemaHandlingException

getGenerator

public org.enableit.db.darrt.DDLGenerator getGenerator(org.enableit.db.beans.Provider provider)
                                                throws ConfigurationException
Returns the appropriate generator for the provider specified.

Parameters:
provider - Defines database DDLGenerator is required for. May be null.
Returns:
DDLGenerator.
ConfigurationException

getGenerator

public org.enableit.db.darrt.DDLGenerator getGenerator(java.lang.String productName)
                                                throws ConfigurationException
Returns the appropriate generator for the provider specified.

Parameters:
productName - Defines database DDLGenerator is required for. May be null.
Returns:
DDLGenerator.
ConfigurationException


Copyright © 1999-2004 enableIT.org. All Rights Reserved.