public class WriteSchemaSqlToFileCommand extends DatabaseCommandWithCreationParameters
database sub element) or the
databaseType attribute is used to specify the database type._addIdentityUsingAlterTable, _isolationLevel, _platformConf| Constructor and Description |
|---|
WriteSchemaSqlToFileCommand() |
| Modifier and Type | Method and Description |
|---|---|
void |
addConfiguredDatabase(org.apache.commons.dbcp.BasicDataSource dataSource)
Adds the data source to use for accessing the database.
|
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 SQL is generated to drop tables and the associated constraints
if necessary.
|
boolean |
isExportAll()
Return true if all database object have to be exported directly by the
target platform database (only for GemFireXD).
|
boolean |
isExportDDLs()
Return true if DDLs have to be exported directly by the target platform
database (only for GemFireXD).
|
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).
|
void |
setAlterDatabase(boolean alterTheDb)
Specifies whether DdlUtils shall generate SQL to alter an existing database rather
than SQL for clearing it and creating it new.
|
void |
setCatalogPattern(String catalogPattern)
Specifies a pattern that defines which database catalogs to use.
|
void |
setDatabaseType(String type)
Specifies the database type.
|
void |
setDoDrops(boolean doDrops)
Specifies whether SQL for dropping tables, external constraints, etc.
|
void |
setExportAll(boolean exportAll)
Set the flag for
isExportAll(). |
void |
setExportDDLs(boolean exportDDLs)
Set the flag for
isExportDDLs(). |
void |
setOutputFile(File outputFile)
Specifies the name of the file to write the SQL commands to.
|
protected void |
setPlatformConfiguration(PlatformConfiguration platformConf)
Sets the platform configuration.
|
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).
|
addConfiguredParameter, getFilteredParametersgetCatalogPattern, getDatabaseType, getDataSource, getIsolationLevel, getPlatform, getSchemaPattern, isAddIdentityUsingAlterTable, isRequiringModel, setAddIdentityUsingAlterTable, setIsolationLevelhandleException, isFailOnError, setFailOnErrorpublic void setOutputFile(File outputFile)
outputFile - The output fileprotected boolean isAlterDatabase()
true if to alter the databasepublic void setAlterDatabase(boolean alterTheDb)
alterTheDb - true if SQL to alter the database shall be createdprotected boolean isDoDrops()
true if drops SQL shall be generated if necessarypublic void setDoDrops(boolean doDrops)
alterDatabase is false.doDrops - true if drops shall be performed if necessarypublic void execute(DatabaseTaskBase task, Database model) throws org.apache.tools.ant.BuildException
public boolean isExportDDLs()
public boolean isExportAll()
public void setExportDDLs(boolean exportDDLs)
isExportDDLs().public void setExportAll(boolean exportAll)
isExportAll().protected void setPlatformConfiguration(PlatformConfiguration platformConf)
setPlatformConfiguration in class DatabaseCommandplatformConf - The platform configurationpublic 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 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 downCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.