org.enableit.db.darrt.ext
Class DeclarativeDDLGenerator

java.lang.Object
  |
  +--org.enableit.db.darrt.AbstractDDLGenerator
        |
        +--org.enableit.db.darrt.ext.DeclarativeDDLGenerator
All Implemented Interfaces:
DDLGenerator

public class DeclarativeDDLGenerator
extends AbstractDDLGenerator
implements DDLGenerator

RDBMS-specific extensions backed by XML files.


Field Summary
static java.lang.String ABOUT
          CVS info about this class and its current version
 
Fields inherited from class org.enableit.db.darrt.AbstractDDLGenerator
EOL
 
Fields inherited from interface org.enableit.db.darrt.DDLGenerator
NO_DEFINITION_AVAILABLE
 
Constructor Summary
DeclarativeDDLGenerator()
          Default constructor.
DeclarativeDDLGenerator(java.lang.String resourceName)
          Constructor that also sets the resource to configure with.
 
Method Summary
 java.util.List getCreate(java.lang.Object dataObject)
          Create a database object that does not currently exist.
 java.lang.String getDataType(java.lang.String schemaDataType)
          Returns this RDBMS' implementation for the JDBC type.
 java.lang.String getFormattedDate(java.lang.String colName, java.lang.String format)
          Returns this RDBMS' implementation of formatted date (including time and datetime).
 java.lang.String getGenericDefault(java.lang.String dbmsDefault)
          Converts the DBMS specific default string into a generic (Darrt) one.
 java.util.List getModify(org.enableit.db.darrt.beans.DiffData diff)
          Returns the DDL to create the modification between the reference and targets.
 java.lang.String getName()
          Return the name of this DDLGenerator.
 java.lang.String getSubstring(java.lang.String colName, int from, int to)
          Returns this RDBMS' implementation of substring.
 void setResourceName(java.lang.String resourceName)
          Sets the resource name to read to instantiate from.
 
Methods inherited from class org.enableit.db.darrt.AbstractDDLGenerator
getCreateIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.enableit.db.darrt.DDLGenerator
getCreateIndex
 

Field Detail

ABOUT

public static final java.lang.String ABOUT
CVS info about this class and its current version

See Also:
Constant Field Values
Constructor Detail

DeclarativeDDLGenerator

public DeclarativeDDLGenerator()
Default constructor.


DeclarativeDDLGenerator

public DeclarativeDDLGenerator(java.lang.String resourceName)
                        throws ConfigurationException
Constructor that also sets the resource to configure with.

Parameters:
resourceName - The resource name to read.
Throws:
ConfigurationException - If no meta-data definition available for the specified resourceName.
Method Detail

setResourceName

public void setResourceName(java.lang.String resourceName)
                     throws ConfigurationException
Sets the resource name to read to instantiate from.

Parameters:
resourceName - The resource name to read config'n from.
Throws:
ConfigurationException - If no meta-data definition available for the specified resourceName.

getName

public java.lang.String getName()
Description copied from interface: DDLGenerator
Return the name of this DDLGenerator.

Specified by:
getName in interface DDLGenerator
Returns:
the name of this DDLGenerator.

getCreate

public java.util.List getCreate(java.lang.Object dataObject)
Create a database object that does not currently exist.

Specified by:
getCreate in interface DDLGenerator
Parameters:
dataObject - Java representation of the data object to create.
Returns:
List of DDL statements (String type).

getModify

public java.util.List getModify(org.enableit.db.darrt.beans.DiffData diff)
Description copied from interface: DDLGenerator
Returns the DDL to create the modification between the reference and targets.

Specified by:
getModify in interface DDLGenerator
Parameters:
diff -
Returns:
List of DDL statements (String type).

getDataType

public java.lang.String getDataType(java.lang.String schemaDataType)
Returns this RDBMS' implementation for the JDBC type.


getSubstring

public java.lang.String getSubstring(java.lang.String colName,
                                     int from,
                                     int to)
Description copied from interface: DDLGenerator
Returns this RDBMS' implementation of substring.

Specified by:
getSubstring in interface DDLGenerator
See Also:
DDLGenerator.getSubstring(java.lang.String, int, int)

getFormattedDate

public java.lang.String getFormattedDate(java.lang.String colName,
                                         java.lang.String format)
Description copied from interface: DDLGenerator
Returns this RDBMS' implementation of formatted date (including time and datetime).

Specified by:
getFormattedDate in interface DDLGenerator
See Also:
DDLGenerator.getFormattedDate(java.lang.String, java.lang.String)

getGenericDefault

public java.lang.String getGenericDefault(java.lang.String dbmsDefault)
Description copied from interface: DDLGenerator
Converts the DBMS specific default string into a generic (Darrt) one.

Specified by:
getGenericDefault in interface DDLGenerator
Parameters:
dbmsDefault -
Returns:
RDBMS independent default defintion.
See Also:
DDLGenerator.getGenericDefault(java.lang.String)


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