|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kodo.jdbc.schema.SchemaTool
The SchemaTool is used to manage the database schema.
Field Summary | |
static String |
ACTION_ADD
|
static String |
ACTION_BUILD
|
static String |
ACTION_CREATEDB
|
static String |
ACTION_DROP
|
static String |
ACTION_DROPDB
|
static String |
ACTION_EXPORT
|
static String |
ACTION_IMPORT
|
static String |
ACTION_REFRESH
|
static String |
ACTION_RETAIN
|
static String[] |
ACTIONS
|
Constructor Summary | |
SchemaTool(JDBCConfiguration conf)
Construct a SchemaTool that will use the given database. |
Method Summary | |
void |
add()
Adds any components present in the schema repository but absent from the database. |
boolean |
addColumn(Column col)
Add the given column to the database schema. |
boolean |
addForeignKey(ForeignKey fk)
Add the given foreign key to the database schema. |
boolean |
addPrimaryKey(PrimaryKey pk)
Add the given primary key to the database schema. |
void |
build()
Re-execute all SQL used for the creation of the current database; this action is usually used when creating SQL scripts. |
void |
createDB()
Re-execute all SQL used for the creation of the current database; this action is usually used when creating SQL scripts. |
boolean |
createIndex(Index idx,
Table table)
Add the given index to the database schema. |
boolean |
createTable(Table table)
Add the given table to the database schema. |
void |
drop()
Drops all schema components in the schema repository that also exist in the database. |
boolean |
dropColumn(Column col)
Drop the given column from the database schema. |
void |
dropDB()
Drop the current database. |
boolean |
dropForeignKey(ForeignKey fk)
Drop the given foreign key from the database schema. |
boolean |
dropIndex(Index idx)
Drop the given index from the database schema. |
boolean |
dropPrimaryKey(PrimaryKey pk)
Drop the given primary key from the database schema. |
boolean |
dropTable(Table table)
Drop the given table from the database schema. |
SchemaGroup |
getDBSchemaGroup()
Return the database schema. |
boolean |
getDropTables()
If true, tables that appear to be unused will be dropped. |
boolean |
getForeignKeys()
Return whether foreign keys should be manipulated. |
boolean |
getIgnoreErrors()
If true, SQLExceptions thrown during schema manipulation will be printed but ignored. |
boolean |
getIndexes()
Return whether indexes should be manipulated. |
boolean |
getKodoTables()
Whether to act on special tables used by Kodo components for bookkeeping. |
boolean |
getPrimaryKeys()
Return whether primary keys should be generated. |
SchemaGroup |
getSchemaGroup()
Return the schema group the tool will act on. |
PrintWriter |
getScriptWriter()
The stream to write to for the creation of SQL scripts. |
static void |
main(String[] args)
Usage: java kodo.jdbc.schema.SchemaTool [option]* -action/-a <add | retain | drop | refresh | createDB | dropDB | build | import | export> <.schema file or resource>* |
void |
record()
Record the changes made to the DB in the current SchemaFactory . |
void |
refresh()
Adds any components present in the schema repository but absent from the database, and drops unused database components. |
void |
retain()
Drops database components that are not mentioned in the schema repository. |
static boolean |
run(JDBCConfiguration conf,
String[] args,
serp.util.Options opts)
Run the tool. |
static boolean |
run(JDBCConfiguration conf,
String action,
String[] args,
Writer scriptWriter,
boolean dropTables,
boolean ignoreErrors,
boolean kodoTables,
boolean pks,
boolean fks,
boolean indexes,
boolean record,
ClassLoader loader)
Run the tool. |
void |
setDBSchemaGroup(SchemaGroup db)
Set the database schema. |
void |
setDropTables(boolean dropTables)
If true, tables that appear to be unused will be dropped. |
void |
setForeignKeys(boolean fks)
Set whether foreign keys should be generated. |
void |
setIgnoreErrors(boolean ignoreErrs)
If true, SQLExceptions thrown during schema manipulation will be printed but ignored. |
void |
setIndexes(boolean indexes)
Set whether indexes should be manipulated. |
void |
setKodoTables(boolean kodoTables)
Whether to act on special tables used by Kodo components for bookkeeping. |
void |
setPrimaryKeys(boolean pks)
Set whether primary keys should be generated. |
void |
setSchemaGroup(SchemaGroup group)
Set the schema group the tool will act on. |
void |
setScriptWriter(PrintWriter writer)
The stream to write to for the creation of SQL scripts. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String ACTION_ADD
public static final String ACTION_DROP
public static final String ACTION_RETAIN
public static final String ACTION_REFRESH
public static final String ACTION_BUILD
public static final String ACTION_CREATEDB
public static final String ACTION_DROPDB
public static final String ACTION_IMPORT
public static final String ACTION_EXPORT
public static final String[] ACTIONS
Constructor Detail |
public SchemaTool(JDBCConfiguration conf)
Method Detail |
public boolean getIgnoreErrors()
public void setIgnoreErrors(boolean ignoreErrs)
public boolean getDropTables()
public void setDropTables(boolean dropTables)
public boolean getKodoTables()
public void setKodoTables(boolean kodoTables)
public boolean getIndexes()
public void setIndexes(boolean indexes)
public boolean getForeignKeys()
public void setForeignKeys(boolean fks)
public boolean getPrimaryKeys()
public void setPrimaryKeys(boolean pks)
public PrintWriter getScriptWriter()
public void setScriptWriter(PrintWriter writer)
public SchemaGroup getSchemaGroup()
public void setSchemaGroup(SchemaGroup group)
public void add() throws SQLException
public void drop() throws SQLException
public void retain() throws SQLException
public void refresh() throws SQLException
public void createDB() throws SQLException
public void build() throws SQLException
public void dropDB() throws SQLException
public void record()
SchemaFactory
.public boolean createTable(Table table) throws SQLException
public boolean dropTable(Table table) throws SQLException
public boolean createIndex(Index idx, Table table) throws SQLException
public boolean dropIndex(Index idx) throws SQLException
public boolean addColumn(Column col) throws SQLException
public boolean dropColumn(Column col) throws SQLException
public boolean addPrimaryKey(PrimaryKey pk) throws SQLException
public boolean dropPrimaryKey(PrimaryKey pk) throws SQLException
public boolean addForeignKey(ForeignKey fk) throws SQLException
public boolean dropForeignKey(ForeignKey fk) throws SQLException
public SchemaGroup getDBSchemaGroup()
public void setDBSchemaGroup(SchemaGroup db)
public static void main(String[] args) throws IOException, SQLException
Usage: java kodo.jdbc.schema.SchemaTool [option]* -action/-a <add | retain | drop | refresh | createDB | dropDB | build | import | export> <.schema file or resource>*
Where the following options are recognized.
JDBCConfiguration
. Optional.JDBCConfiguration
can be set by
using their names and supplying a value. For example:
-licenseKey adslfja83r3lkadf
false
.export
action.retain
and refresh
actions. Defaults to
true
.false
to prevent writing the schema changes to the
current SchemaFactory
.The various actions are as follows.
file
option.file
option.dropTables
.SchemaFactory
.SchemaFactory
's recorded
schema to an XML schema definition file.Examples:
java kodo.jdbc.schema.SchemaTool
-file stdout -action createDB
java kodo.jdbc.schema.SchemaTool
-action dropDB
java kodo.jdbc.schema.SchemaTool
-action add myschema.xml
public static boolean run(JDBCConfiguration conf, String[] args, serp.util.Options opts) throws IOException, SQLException
main(java.lang.String[])
public static boolean run(JDBCConfiguration conf, String action, String[] args, Writer scriptWriter, boolean dropTables, boolean ignoreErrors, boolean kodoTables, boolean pks, boolean fks, boolean indexes, boolean record, ClassLoader loader) throws IOException, SQLException
|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |