|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.ddlutils.task.Command
org.apache.ddlutils.task.DatabaseCommand
org.apache.ddlutils.task.DatabaseCommandWithCreationParameters
org.apache.ddlutils.task.WriteSchemaSqlToFileCommand
public class WriteSchemaSqlToFileCommand
Parses the schema XML files specified in the enclosing task, and writes the SQL statements
necessary to create this schema in the database, to a file. Note that this SQL is
database specific and hence this subtask requires that for the enclosing task, either a
data source is specified (via the database sub element) or the
databaseType attribute is used to specify the database type.
| Field Summary |
|---|
| Fields inherited from class org.apache.ddlutils.task.Command |
|---|
_log |
| Constructor Summary | |
|---|---|
WriteSchemaSqlToFileCommand()
|
|
| Method Summary | |
|---|---|
void |
execute(DatabaseTaskBase task,
Database model)
Executes this command. |
protected boolean |
isAlterDatabase()
Determines whether to alter the database if it already exists, or re-set it. |
protected boolean |
isDoDrops()
Determines whether SQL is generated to drop tables and the associated constraints if necessary. |
void |
setAlterDatabase(boolean alterTheDb)
Specifies whether DdlUtils shall generate SQL to alter an existing database rather than SQL for clearing it and creating it new. |
void |
setDoDrops(boolean doDrops)
Specifies whether SQL for dropping tables, external constraints, etc. |
void |
setOutputFile(File outputFile)
Specifies the name of the file to write the SQL commands to. |
| Methods inherited from class org.apache.ddlutils.task.DatabaseCommandWithCreationParameters |
|---|
addConfiguredParameter, getFilteredParameters |
| Methods inherited from class org.apache.ddlutils.task.DatabaseCommand |
|---|
getCatalogPattern, getDatabaseType, getDataSource, getPlatform, getSchemaPattern, isRequiringModel, setPlatformConfiguration |
| Methods inherited from class org.apache.ddlutils.task.Command |
|---|
handleException, isFailOnError, setFailOnError |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WriteSchemaSqlToFileCommand()
| Method Detail |
|---|
public void setOutputFile(File outputFile)
outputFile - The output fileprotected boolean isAlterDatabase()
true if to alter the databasepublic void setAlterDatabase(boolean alterTheDb)
alterTheDb - true if SQL to alter the database shall be createdprotected boolean isDoDrops()
true if drops SQL shall be generated if necessarypublic void setDoDrops(boolean doDrops)
alterDatabase is false.
doDrops - true if drops shall be performed if necessary
public void execute(DatabaseTaskBase task,
Database model)
throws org.apache.tools.ant.BuildException
execute in class Commandtask - The executing taskmodel - The database model
org.apache.tools.ant.BuildException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||