|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.ddlutils.task.DatabaseTaskBase
org.apache.ddlutils.task.DatabaseToDdlTask
Task for getting structural info and data from a live database. Eg. it has sub tasks for
writing the schema of the live database or the data currently in it to an XML file, for
creating the DTDs for these data files, and for generating SQL to creating a schema in the
database to a file.
Example:
<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.
Nested Class Summary |
Nested classes inherited from class org.apache.ddlutils.task.DatabaseTaskBase |
DatabaseTaskBase.VerbosityLevel |
Field Summary |
Fields inherited from class org.apache.ddlutils.task.DatabaseTaskBase |
_log |
Fields inherited from class org.apache.tools.ant.Task |
target, taskName, taskType, wrapper |
Fields inherited from class org.apache.tools.ant.ProjectComponent |
description, location, project |
Constructor Summary | |
DatabaseToDdlTask()
|
Method Summary | |
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 |
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. |
Methods inherited from class org.apache.ddlutils.task.DatabaseTaskBase |
addCommand, addConfiguredDatabase, execute, executeCommands, getCommands, getDatabaseType, getDataSource, getPlatform, getPlatformConfiguration, hasCommands, isShutdownDatabase, isSortForeignKeys, isUseDelimitedSqlIdentifiers, setCatalogPattern, setDatabaseType, setSchemaPattern, setShutdownDatabase, setSortForeignKeys, setUseDelimitedSqlIdentifiers, setVerbosity |
Methods inherited from class org.apache.tools.ant.Task |
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
Methods inherited from class org.apache.tools.ant.ProjectComponent |
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DatabaseToDdlTask()
Method Detail |
public 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 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 commandprotected Database readModel()
readModel
in class DatabaseTaskBase
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |