public abstract class DatabaseTaskBase
extends org.apache.tools.ant.Task
| Modifier and Type | Field and Description |
|---|---|
protected int |
_isolationLevel |
protected org.apache.commons.logging.Log |
_log
The log.
|
| Constructor and Description |
|---|
DatabaseTaskBase() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
int |
getIsolationLevel()
Get the current isolation level set for this platform.
|
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 |
setIsolationLevel(int level)
Set the transaction isolation level to use for all DB operations.
|
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.
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypeprotected org.apache.commons.logging.Log _log
protected int _isolationLevel
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, oracle11, postgresql, sapdb,
gemfirexd, sybasetype - 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 modelorg.apache.tools.ant.BuildExceptionpublic void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildExceptionpublic final int getIsolationLevel()
public void setIsolationLevel(int level)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.