public class DatabaseToDdlTask extends DatabaseTaskBase
<taskdef classname="org.apache.ddlutils.task.DatabaseToDdlTask"
name="databaseToDdl"
classpathref="project-classpath" />
<databaseToDdl usedelimitedsqlidentifiers="true"
modelname="example">
<database driverclassname="org.apache.derby.jdbc.ClientDriver"
url="jdbc:derby://localhost/ddlutils"
username="ddlutils"
password="ddlutils"/>
<writeschematofile outputfile="schema.xml"/>
<writedatatofile outputfile="data.xml"
encoding="ISO-8859-1"/>
</databaseToDdl>
This reads the schema and data from the database and writes them to XML files._isolationLevel, _log| Constructor and Description |
|---|
DatabaseToDdlTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDropTables(DropTablesCommand command)
Adds the "drop tables"-command.
|
void |
addWriteDataToDatabase(WriteDataToDatabaseCommand command)
Adds the "write data into database"-command.
|
void |
addWriteDataToFile(WriteDataToFileCommand command)
Adds the "write data into file"-command.
|
void |
addWriteDtdToFile(WriteDtdToFileCommand command)
Adds the "create dtd"-command.
|
void |
addWriteSchemaSqlToFile(WriteSchemaSqlToFileCommand command)
Adds the "write schema sql to file"-command.
|
void |
addWriteSchemaToFile(WriteSchemaToFileCommand command)
Adds the "write schema to file"-command.
|
protected Database |
readModel()
Reads the database model on which the commands will work.
|
void |
setExcludeTableFilter(String tableNameRegExp)
Sets the regular expression matching the names of the tables that shall be ignored.
|
void |
setExcludeTables(String tableNameList)
Sets the names of the tables that shall be ignored, as a comma-separated list.
|
void |
setIncludeTableFilter(String tableNameRegExp)
Sets the regular expression matching the names of the tables that shall be read.
|
void |
setIncludeTables(String tableNameList)
Sets the names of the tables that shall be read, as a comma-separated list.
|
void |
setModelName(String modelName)
Specifies the name of the model that is read from the database.
|
void |
setTableTypes(String tableTypes)
Specifies the table types to be processed.
|
addCommand, addConfiguredDatabase, execute, executeCommands, getCommands, getDatabaseType, getDataSource, getIsolationLevel, getPlatform, getPlatformConfiguration, hasCommands, isShutdownDatabase, isSortForeignKeys, isUseDelimitedSqlIdentifiers, setCatalogPattern, setDatabaseType, setIsolationLevel, setSchemaPattern, setShutdownDatabase, setSimpleLogging, setSortForeignKeys, setUseDelimitedSqlIdentifiers, setVerbositybindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypepublic void setTableTypes(String tableTypes)
tableTypes - The table types as a comma-separated listpublic void setModelName(String modelName)
writeSchemaToFile sub-task as it ensures that the generated
XML defines a valid model.modelName - The model name. Use null or an empty string for the default namepublic void setIncludeTables(String tableNameList)
tableNameList - The comma-separated list of table namespublic void setIncludeTableFilter(String tableNameRegExp)
tableNameRegExp - The regular expression; see Pattern
for detailspublic void setExcludeTables(String tableNameList)
tableNameList - The comma-separated list of table namespublic void setExcludeTableFilter(String tableNameRegExp)
tableNameRegExp - The regular expression; see Pattern
for detailspublic void addWriteDtdToFile(WriteDtdToFileCommand command)
command - The commandpublic void addWriteSchemaToFile(WriteSchemaToFileCommand command)
command - The commandpublic void addWriteSchemaSqlToFile(WriteSchemaSqlToFileCommand command)
command - The commandpublic void addWriteDataToDatabase(WriteDataToDatabaseCommand command)
command - The commandpublic void addWriteDataToFile(WriteDataToFileCommand command)
command - The commandpublic void addDropTables(DropTablesCommand command)
command - The commandprotected Database readModel()
readModel in class DatabaseTaskBaseCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.