|
||||||||||
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
Base class for DdlUtils Ant tasks that operate on a database.
Nested Class Summary | |
static class |
DatabaseTaskBase.VerbosityLevel
Helper class that defines the possible values for the verbosity attribute. |
Field Summary | |
protected org.apache.commons.logging.Log |
_log
The 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 | |
DatabaseTaskBase()
|
Method Summary | |
protected void |
addCommand(Command command)
Adds a command. |
void |
addConfiguredDatabase(org.apache.commons.dbcp.BasicDataSource dataSource)
Adds the data source to use for accessing the database. |
void |
execute()
|
protected void |
executeCommands(Database model)
Executes the commands. |
protected Iterator |
getCommands()
Returns the commands. |
String |
getDatabaseType()
Returns the database type. |
org.apache.commons.dbcp.BasicDataSource |
getDataSource()
Returns the data source. |
protected Platform |
getPlatform()
Creates the platform for the configured database. |
protected PlatformConfiguration |
getPlatformConfiguration()
Creates the platform configuration. |
protected boolean |
hasCommands()
Determines whether there are commands to perform. |
boolean |
isShutdownDatabase()
Determines whether the database shall be shut down after the task has finished. |
boolean |
isSortForeignKeys()
Determines whether a table's foreign keys read from a live database shall be sorted alphabetically. |
boolean |
isUseDelimitedSqlIdentifiers()
Determines whether delimited SQL identifiers shall be used (the default). |
protected abstract Database |
readModel()
Reads the database model on which the commands will work. |
void |
setCatalogPattern(String catalogPattern)
Specifies a pattern that defines which database catalogs to use. |
void |
setDatabaseType(String type)
Specifies the database type. |
void |
setSchemaPattern(String schemaPattern)
Specifies a pattern that defines which database schemas to use. |
void |
setShutdownDatabase(boolean shutdownDatabase)
Specifies whether DdlUtils shall shut down the database after the task has finished. |
void |
setSortForeignKeys(boolean sortForeignKeys)
Specifies whether DdlUtils shall sort the foreign keys of a table read from a live database or leave them in the order in which they are returned by the database/JDBC driver. |
void |
setUseDelimitedSqlIdentifiers(boolean useDelimitedSqlIdentifiers)
Specifies whether DdlUtils shall use delimited (quoted) identifiers (such as table and column names). |
void |
setVerbosity(DatabaseTaskBase.VerbosityLevel level)
Specifies the verbosity of the task's debug output. |
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 |
Field Detail |
protected org.apache.commons.logging.Log _log
Constructor Detail |
public DatabaseTaskBase()
Method Detail |
public void setVerbosity(DatabaseTaskBase.VerbosityLevel level)
INFO
.
level
- The verbosity levelpublic String getDatabaseType()
public void setDatabaseType(String type)
axion, cloudscape, db2, derby, firebird, hsqldb, interbase,
maxdb, mckoi, mssql, mysql, mysql5, oracle, oracle9, oracle10, postgresql, sapdb, sybase
type
- The database typepublic org.apache.commons.dbcp.BasicDataSource getDataSource()
public void addConfiguredDatabase(org.apache.commons.dbcp.BasicDataSource dataSource)
dataSource
- The data sourcepublic void setCatalogPattern(String catalogPattern)
catalogPattern
- The catalog patternpublic void setSchemaPattern(String schemaPattern)
schemaPattern
- The schema patternpublic boolean isUseDelimitedSqlIdentifiers()
true
if delimited SQL identifiers shall be usedpublic void setUseDelimitedSqlIdentifiers(boolean useDelimitedSqlIdentifiers)
useDelimitedSqlIdentifiers
- true
if delimited SQL identifiers shall be usedpublic boolean isSortForeignKeys()
false
by default.
true
if the foreign keys shall be sortedpublic void setSortForeignKeys(boolean sortForeignKeys)
useDelimitedSqlIdentifiers
is set to true
).
sortForeignKeys
- true
if the foreign keys shall be sortedpublic boolean isShutdownDatabase()
true
if the database shall be shut downpublic void setShutdownDatabase(boolean shutdownDatabase)
shutdownDatabase
- true
if the database shall be shut downprotected void addCommand(Command command)
command
- The commandprotected boolean hasCommands()
true
if there are commandsprotected Iterator getCommands()
protected PlatformConfiguration getPlatformConfiguration()
protected Platform getPlatform()
protected abstract Database readModel()
protected void executeCommands(Database model) throws org.apache.tools.ant.BuildException
model
- The database model
org.apache.tools.ant.BuildException
public void execute() throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |