|
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.SchemaGenerator
The SchemaGenerator creates Schemas matching the current
database. All schemas are added to the current SchemaGroup.
Note that tables whose name starts with "JDO" will be not be added
to the database schema. This enables the creation of special tables
that will never be dropped by the SchemaTool.
| Constructor Summary | |
SchemaGenerator(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf)
Constructor. |
|
| Method Summary | |
void |
generateForeignKeys(java.lang.String schemaName)
Generate foreign key information for the given schema. |
void |
generateForeignKeys(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table,
java.sql.Connection conn,
java.sql.DatabaseMetaData meta)
Generates table foreign keys. |
void |
generateIndexes(java.lang.String schemaName)
Generate index information for the given schema. |
void |
generateIndexes(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table,
java.sql.Connection conn,
java.sql.DatabaseMetaData meta)
Generates table indexes. |
void |
generatePrimaryKey(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table,
java.sql.Connection conn,
java.sql.DatabaseMetaData meta)
Generates table primary keys. |
void |
generatePrimaryKeys(java.lang.String schemaName)
Generate primary key information for the given schema. |
void |
generateSchema(java.lang.String name,
java.lang.String[] tableNames)
Add a fully-constructed Schema matching the given database
schema to the current group. |
void |
generateSchemas()
Generate all schemas set in the configuration. |
void |
generateSchemas(java.lang.String[] schemasAndTables)
Generate the schemas and/or tables named in the given strings. |
void |
generateTables(java.lang.String schemaName,
java.lang.String tableName,
java.sql.Connection conn,
java.sql.DatabaseMetaData meta)
Adds all tables matching the given name pattern to the schema. |
boolean |
getGenerateForeignKeys()
Return whether foreign keys should be generated. |
boolean |
getGenerateIndexes()
Return whether indexes should be generated. |
boolean |
getGeneratePrimaryKeys()
Return whether primary keys should be generated. |
com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup |
getSchemaGroup()
Return the current schema group. |
static void |
main(java.lang.String[] args)
Usage: java com.solarmetric.kodo.impl.schema.SchemaGenerator [option]* |
static void |
run(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf,
boolean pks,
boolean indexes,
boolean fks,
java.io.Writer out)
Run the tool. |
void |
setGenerateForeignKeys(boolean fks)
Set whether foreign keys should be generated. |
void |
setGenerateIndexes(boolean indexes)
Set whether indexes should be generated. |
void |
setGeneratePrimaryKeys(boolean pks)
Set whether primary keys should be generated. |
void |
setSchemaGroup(com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup group)
Set the schema group to add generated schemas to. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SchemaGenerator(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf)
conf - configuration for connecting to the data store| Method Detail |
public boolean getGenerateIndexes()
public void setGenerateIndexes(boolean indexes)
public boolean getGenerateForeignKeys()
public void setGenerateForeignKeys(boolean fks)
public boolean getGeneratePrimaryKeys()
public void setGeneratePrimaryKeys(boolean pks)
public com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup getSchemaGroup()
public void setSchemaGroup(com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup group)
public void generateSchemas()
throws java.sql.SQLException
generateIndexes(java.lang.String), generatePrimaryKeys(java.lang.String), and
generateForeignKeys(java.lang.String) automatically.
java.sql.SQLException
public void generateSchemas(java.lang.String[] schemasAndTables)
throws java.sql.SQLException
main(java.lang.String[]) method description for how to specify schema
and table names. This method calls generateIndexes(java.lang.String),
generatePrimaryKeys(java.lang.String), and generateForeignKeys(java.lang.String)
automatically.
java.sql.SQLException
public void generateSchema(java.lang.String name,
java.lang.String[] tableNames)
throws java.sql.SQLException
Schema matching the given database
schema to the current group. No foreign keys are generated because
some keys might span schemas. You must call
generatePrimaryKeys(java.lang.String), generateIndexes(java.lang.String), and
generateForeignKeys(java.lang.String) separately.
name - the database name of the schema, or null for all
schemas
java.sql.SQLException
public void generatePrimaryKeys(java.lang.String schemaName)
throws java.sql.SQLException
generateSchema(java.lang.String, java.lang.String[]). It should
only be called after all schemas are generated. The schema name can
be null to indicate that indexes should be generated for all schemas.
java.sql.SQLException
public void generateIndexes(java.lang.String schemaName)
throws java.sql.SQLException
generateSchema(java.lang.String, java.lang.String[]). It should
only be called after all schemas are generated. The schema name
can be null to indicate that indexes should be generated for all
schemas.
java.sql.SQLException
public void generateForeignKeys(java.lang.String schemaName)
throws java.sql.SQLException
generateSchema(java.lang.String, java.lang.String[]). It should
only be called after all schemas that are linked via foreign keys
are generated. The schema name given can be null to indicate that
foreign keys should be generated for all schemas.
java.sql.SQLException
public void generateTables(java.lang.String schemaName,
java.lang.String tableName,
java.sql.Connection conn,
java.sql.DatabaseMetaData meta)
throws java.sql.SQLException
java.sql.SQLException
public void generatePrimaryKey(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table,
java.sql.Connection conn,
java.sql.DatabaseMetaData meta)
throws java.sql.SQLException
java.sql.SQLException
public void generateIndexes(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table,
java.sql.Connection conn,
java.sql.DatabaseMetaData meta)
throws java.sql.SQLException
java.sql.SQLException
public void generateForeignKeys(com.solarmetric.rd.kodo.impl.jdbc.schema.Table table,
java.sql.Connection conn,
java.sql.DatabaseMetaData meta)
throws java.sql.SQLException
java.sql.SQLException
public static void main(java.lang.String[] args)
throws java.io.IOException,
java.sql.SQLException
Usage: java com.solarmetric.kodo.impl.schema.SchemaGenerator [option]*
Where the following options are recognized.
JDBCConfiguration. Optional.JDBCConfiguration can be set by
using their names and supplying a value. For example:
-licenseKey adslfja83r3lkadfYou can use the -schemas argument to give a comma-
separated list of schemas and tables to generate. All table names
must be of the form <schema>.<table>. If the
table's schema is unknown or null, specify the table name with a
preceding period: .<table>. If a schema name is
given but no tables are listed for that schema, all tables in the
shcema will be generated. If no arguments at all are given, all
tables of all schemas listed in the JDBCConfiguration will be
generated.
java.io.IOException
java.sql.SQLException
public static void run(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf,
boolean pks,
boolean indexes,
boolean fks,
java.io.Writer out)
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 | |||||||||