|
SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaTool
The SchemaTool is used to manage the database schema.
| Field Summary | |
static java.lang.String |
ACTION_ADD
|
static java.lang.String |
ACTION_CREATEDB
|
static java.lang.String |
ACTION_DROP
|
static java.lang.String |
ACTION_DROPDB
|
static java.lang.String |
ACTION_EXPORT
|
static java.lang.String |
ACTION_IMPORT
|
static java.lang.String |
ACTION_REFRESH
|
static java.lang.String |
ACTION_RETAIN
|
| Constructor Summary | |
SchemaTool(com.solarmetric.rd.kodo.impl.jdbc.conf.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(com.solarmetric.rd.kodo.impl.jdbc.schema.Column col)
Add the given column to the database schema. |
boolean |
addForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)
Add the given foreign key to the database schema. |
boolean |
addPrimaryKey(com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey pk)
Add the given primary key to the database schema. |
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(com.solarmetric.rd.kodo.impl.jdbc.schema.Index idx)
Add the given index to the database schema. |
boolean |
createTable(com.solarmetric.rd.kodo.impl.jdbc.schema.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(com.solarmetric.rd.kodo.impl.jdbc.schema.Column col)
Drop the given column from the database schema. |
void |
dropDB()
Drop the current database. |
boolean |
dropForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)
Drop the given foreign key from the database schema. |
boolean |
dropIndex(com.solarmetric.rd.kodo.impl.jdbc.schema.Index idx)
Drop the given index from the database schema. |
boolean |
dropPrimaryKey(com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey pk)
Drop the given primary key from the database schema. |
boolean |
dropTable(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table)
Drop the given table from the database schema. |
com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup |
getDBSchemaGroup()
Return the database schema. |
boolean |
getDropTables()
If true, tables that appear to be unused will be dropped. |
boolean |
getIgnoreErrors()
If true, SQLExceptions thrown during schema manipulation will be printed but ignored. |
com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup |
getSchemaGroup()
Return the schema group the tool will act on. |
java.io.PrintWriter |
getScriptWriter()
The stream to write to for the creation of SQL scripts. |
static void |
main(java.lang.String[] args)
Usage: java com.solarmetric.kodo.impl.schema.SchemaTool [option]* -action/-a <add | retain | drop | refresh | createDB | dropDB | 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(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf,
java.lang.String action,
java.lang.String[] args,
java.io.Writer scriptWriter,
boolean dropTables,
boolean ignoreErrors,
boolean record,
java.lang.ClassLoader loader)
Run the tool. |
void |
setDBSchemaGroup(com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup db)
Set the database schema. |
void |
setDropTables(boolean dropTables)
If true, tables that appear to be unused will be dropped. |
void |
setIgnoreErrors(boolean ignoreErrs)
If true, SQLExceptions thrown during schema manipulation will be printed but ignored. |
void |
setSchemaGroup(com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup group)
Set the schema group the tool will act on. |
void |
setScriptWriter(java.io.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 java.lang.String ACTION_ADD
public static final java.lang.String ACTION_DROP
public static final java.lang.String ACTION_RETAIN
public static final java.lang.String ACTION_REFRESH
public static final java.lang.String ACTION_CREATEDB
public static final java.lang.String ACTION_DROPDB
public static final java.lang.String ACTION_IMPORT
public static final java.lang.String ACTION_EXPORT
| Constructor Detail |
public SchemaTool(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf)
| Method Detail |
public boolean getIgnoreErrors()
public void setIgnoreErrors(boolean ignoreErrs)
public boolean getDropTables()
public void setDropTables(boolean dropTables)
public java.io.PrintWriter getScriptWriter()
public void setScriptWriter(java.io.PrintWriter writer)
public com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup getSchemaGroup()
public void setSchemaGroup(com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup group)
public void add()
throws java.sql.SQLException
java.sql.SQLException
public void drop()
throws java.sql.SQLException
java.sql.SQLException
public void retain()
throws java.sql.SQLException
java.sql.SQLException
public void refresh()
throws java.sql.SQLException
java.sql.SQLException
public void createDB()
throws java.sql.SQLException
java.sql.SQLException
public void dropDB()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void record()
SchemaFactory.
public boolean createTable(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table)
throws java.sql.SQLException
java.sql.SQLException
public boolean dropTable(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table)
throws java.sql.SQLException
java.sql.SQLException
public boolean createIndex(com.solarmetric.rd.kodo.impl.jdbc.schema.Index idx)
throws java.sql.SQLException
java.sql.SQLException
public boolean dropIndex(com.solarmetric.rd.kodo.impl.jdbc.schema.Index idx)
throws java.sql.SQLException
java.sql.SQLException
public boolean addColumn(com.solarmetric.rd.kodo.impl.jdbc.schema.Column col)
throws java.sql.SQLException
java.sql.SQLException
public boolean dropColumn(com.solarmetric.rd.kodo.impl.jdbc.schema.Column col)
throws java.sql.SQLException
java.sql.SQLException
public boolean addPrimaryKey(com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey pk)
throws java.sql.SQLException
java.sql.SQLException
public boolean dropPrimaryKey(com.solarmetric.rd.kodo.impl.jdbc.schema.PrimaryKey pk)
throws java.sql.SQLException
java.sql.SQLException
public boolean addForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)
throws java.sql.SQLException
java.sql.SQLException
public boolean dropForeignKey(com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey fk)
throws java.sql.SQLException
java.sql.SQLExceptionpublic com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup getDBSchemaGroup()
public void setDBSchemaGroup(com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup db)
public static void main(java.lang.String[] args)
throws java.io.IOException,
java.sql.SQLException
Usage: java com.solarmetric.kodo.impl.schema.SchemaTool [option]* -action/-a <add | retain | drop | refresh | createDB | dropDB | 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 adslfja83r3lkadffalse.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.dropTables.SchemaFactory.SchemaFactory's recorded
schema to an XML schema definition file.Examples:
java com.solarmetric.kodo.impl.jdbc.schema.SchemaTool
-file stdout -action createDB
java com.solarmetric.kodo.impl.jdbc.schema.SchemaTool
-action dropDBjava com.solarmetric.kodo.impl.jdbc.schema.SchemaTool
-action add myschema.xml
java.io.IOException
java.sql.SQLException
public static boolean run(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf,
java.lang.String action,
java.lang.String[] args,
java.io.Writer scriptWriter,
boolean dropTables,
boolean ignoreErrors,
boolean record,
java.lang.ClassLoader loader)
throws java.io.IOException,
java.sql.SQLException
java.io.IOException
java.sql.SQLException
|
SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||