|
|||||||||
| 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
public abstract class DatabaseTaskBase
Base class for DdlUtils Ant tasks that operate on a database.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
_log
The log. |
| Fields inherited from class org.apache.tools.ant.Task |
|---|
description, location, target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
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 |
setSimpleLogging(boolean simpleLogging)
Specifies whether simple logging (configured by the task via the verbosity
setting) shall be used, or whether logging is configured outside of the task
(e.g. |
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(VerbosityLevel level)
Specifies the verbosity of the task's debug output. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
getProject, setProject |
| Methods inherited from class java.lang.Object |
|---|
clone, 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 setSimpleLogging(boolean simpleLogging)
verbosity
setting) shall be used, or whether logging is configured outside of the task
(e.g. via a log4j properties file).
simpleLogging - Whether to use simple logging or notpublic void setVerbosity(VerbosityLevel level)
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
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||