org.apache.ddlutils.task
Class WriteSchemaSqlToFileCommand

java.lang.Object
  extended byorg.apache.ddlutils.task.DatabaseCommand
      extended byorg.apache.ddlutils.task.DatabaseCommandWithCreationParameters
          extended byorg.apache.ddlutils.task.WriteSchemaSqlToFileCommand
All Implemented Interfaces:
Command

public class WriteSchemaSqlToFileCommand
extends DatabaseCommandWithCreationParameters

Creates the SQL for a schema and writes it to a file.

Version:
$Revision: 289996 $
Author:
Thomas Dudziak

Constructor Summary
WriteSchemaSqlToFileCommand()
           
 
Method Summary
 void execute(org.apache.tools.ant.Task 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 to drop tables and the associated constraints if necessary.
 void setAlterDatabase(boolean alterTheDb)
          Specifies whether to alter the database if it already exists, or re-set it.
 void setDoDrops(boolean doDrops)
          Specifies whether to drop tables and the associated constraints if necessary.
 void setOutputFile(File outputFile)
          Sets the file to output the sql to.
 
Methods inherited from class org.apache.ddlutils.task.DatabaseCommandWithCreationParameters
addConfiguredParameter, getFilteredParameters
 
Methods inherited from class org.apache.ddlutils.task.DatabaseCommand
getDatabaseType, getDataSource, getPlatform, isFailOnError, isRequiringModel, setFailOnError, setPlatformConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriteSchemaSqlToFileCommand

public WriteSchemaSqlToFileCommand()
Method Detail

setOutputFile

public void setOutputFile(File outputFile)
Sets the file to output the sql 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 to alter the database if it already exists, or re-set it.

Parameters:
alterTheDb - true if to alter the database

isDoDrops

protected boolean isDoDrops()
Determines whether to drop tables and the associated constraints if necessary.

Returns:
true if drops shall be performed if necessary

setDoDrops

public void setDoDrops(boolean doDrops)
Specifies whether to drop tables and the associated constraints if necessary.

Parameters:
doDrops - true if drops shall be performed if necessary

execute

public void execute(org.apache.tools.ant.Task task,
                    Database model)
             throws org.apache.tools.ant.BuildException
Executes this command.

Parameters:
task - The executing task
model - The database model
Throws:
org.apache.tools.ant.BuildException


Copyright © 2005 Apache Software Foundation. All Rights Reserved.