org.apache.ddlutils.task
Class WriteSchemaToDatabaseCommand

java.lang.Object
  extended by org.apache.ddlutils.task.Command
      extended by org.apache.ddlutils.task.DatabaseCommand
          extended by org.apache.ddlutils.task.DatabaseCommandWithCreationParameters
              extended by org.apache.ddlutils.task.WriteSchemaToDatabaseCommand

public class WriteSchemaToDatabaseCommand
extends DatabaseCommandWithCreationParameters

Parses the schema XML files specified for the enclosing task, and creates the corresponding schema in the database.

Version:
$Revision: 289996 $

Field Summary
 
Fields inherited from class org.apache.ddlutils.task.Command
_log
 
Constructor Summary
WriteSchemaToDatabaseCommand()
           
 
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 to drop tables and the associated constraints before re-creating them (this implies alterDatabase is false).
 void setAlterDatabase(boolean alterTheDb)
          Specifies whether DdlUtils shall alter an existing database rather than clearing it and creating it new.
 void setDoDrops(boolean doDrops)
          Specifies whether tables, external constraints, etc.
 
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

WriteSchemaToDatabaseCommand

public WriteSchemaToDatabaseCommand()
Method Detail

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 alter an existing database rather than clearing it and creating it new.

Parameters:
alterTheDb - true if to alter the database

isDoDrops

protected boolean isDoDrops()
Determines whether to drop tables and the associated constraints before re-creating them (this implies alterDatabase is false).

Returns:
true if drops shall be performed

setDoDrops

public void setDoDrops(boolean doDrops)
Specifies whether tables, external constraints, etc. can be dropped if necessary. Note that this is only relevant when alterDatabase is false.

Parameters:
doDrops - true if drops shall be performed

execute

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

Specified by:
execute in class Command
Parameters:
task - The executing task
model - The database model
Throws:
org.apache.tools.ant.BuildException


Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.