Class WriteSchemaSqlToFileCommand
java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.task.Command
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.task.DatabaseCommand
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.task.DatabaseCommandWithCreationParameters
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.task.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.- Version:
- $Revision: 289996 $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(DatabaseTaskBase task, Database model) Executes this command.protected boolean
Determines whether to alter the database if it already exists, or re-set it.protected boolean
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 edu.internet2.middleware.grouper.ext.org.apache.ddlutils.task.DatabaseCommandWithCreationParameters
addConfiguredParameter, getFilteredParameters
Methods inherited from class edu.internet2.middleware.grouper.ext.org.apache.ddlutils.task.DatabaseCommand
getCatalogPattern, getDatabaseType, getDataSource, getPlatform, getSchemaPattern, isRequiringModel, setPlatformConfiguration
Methods inherited from class edu.internet2.middleware.grouper.ext.org.apache.ddlutils.task.Command
handleException, isFailOnError, setFailOnError
-
Constructor Details
-
WriteSchemaSqlToFileCommand
public WriteSchemaSqlToFileCommand()
-
-
Method Details
-
setOutputFile
Specifies the name of the file to write the SQL commands to.- Parameters:
outputFile
- The output file
-
isAlterDatabase
protected boolean isAlterDatabase()Determines whether to alter the database if it already exists, or re-set it.- Returns:
true
if to alter the database
-
setAlterDatabase
public 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.- Parameters:
alterTheDb
-true
if SQL to alter the database shall be created
-
isDoDrops
protected boolean isDoDrops()Determines whether SQL is generated to drop tables and the associated constraints if necessary.- Returns:
true
if drops SQL shall be generated if necessary
-
setDoDrops
public void setDoDrops(boolean doDrops) Specifies whether SQL for dropping tables, external constraints, etc. is created if necessary. Note that this is only relevant whenalterDatabase
isfalse
.- Parameters:
doDrops
-true
if drops shall be performed if necessary
-
execute
public void execute(DatabaseTaskBase task, Database model) throws org.apache.tools.ant.BuildException Executes this command.
-