|
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.meta.MappingTool
Tool for manipulating class mappings and associated schema.
Field Summary | |
static String |
ACTION_BUILD_SCHEMA
|
static String |
ACTION_DROP
|
static String |
ACTION_EXPORT
|
static String |
ACTION_IMPORT
|
static String |
ACTION_REFRESH
|
static String |
ACTION_REVERT
|
static String |
ACTION_VALIDATE
|
static String[] |
ACTIONS
|
Constructor Summary | |
MappingTool(JDBCConfiguration conf)
Constructor. |
Method Summary | |
void |
buildSchema(Class cls)
Update the schema to match the tables and columns dictated by the mappings. |
void |
clear()
Reset the internal repository. |
void |
drop(Class cls)
Remove the given mapping from the list. |
boolean |
getDropUnusedComponents()
Whether schema components that are unused by any mapping will be dropped from this tool's SchemaGroup , and, depending on
the schema action, from the database. |
boolean |
getForeignKeys()
Return whether foreign keys should be manipulated. |
boolean |
getIgnoreErrors()
Whether and SQL errors should cause a failure or just issue a warning. |
boolean |
getIndexes()
Return whether indexes should be manipulated. |
Writer |
getMappingWriter()
The stream to export the planned mappings to as an XML document. |
boolean |
getPrimaryKeys()
Return whether primary keys should be generated. |
boolean |
getReadSchema()
Set to true to read the entire schema before mapping. |
boolean |
getReinstallInfo()
Whether mappings should be re-installed into the mapping factory on record. |
MappingRepository |
getRepository()
Return the repository to use to access mapping information. |
String |
getSchemaAction()
The schema modification policy. |
SchemaGroup |
getSchemaGroup()
Return the schema group to use in mapping. |
SchemaTool |
getSchemaTool()
Return the schema tool to use for schema modification. |
Writer |
getSchemaWriter()
The stream to export the planned schema to as an XML document. |
static void |
main(String[] args)
Usage: java kodo.jdbc.meta.MappingTool [option]* -action/-a <refresh | drop | validate | buildSchema | revert | import | export> <class name | .java file | .class file | .jdo file>+ |
void |
record()
Records the changes that have been made to both the mappings and the associated schema, and clears the tool for further use. |
void |
refresh(Class cls)
Refresh or add the mapping for the given instance. |
void |
revert(Class cls)
Revert the given mapping to its previous state. |
static boolean |
run(JDBCConfiguration conf,
String[] args,
serp.util.Options opts)
Run the tool. |
static boolean |
run(JDBCConfiguration conf,
String action,
String[] args,
Writer mappingWriter,
String schemaAction,
boolean dropTables,
boolean ignoreErrors,
boolean readSchema,
boolean pks,
boolean fks,
boolean indexes,
Writer schemaWriter,
Writer sqlWriter,
ClassLoader loader)
Run the tool. |
void |
setDropUnusedComponents(boolean dropUnused)
Whether schema components that are unused by any mapping will be dropped from this tool's SchemaGroup , and, depending on
the schema action, from the database. |
void |
setForeignKeys(boolean fks)
Set whether foreign keys should be generated. |
void |
setIgnoreErrors(boolean ignoreErrors)
Whether and SQL errors should cause a failure or just issue a warning. |
void |
setIndexes(boolean indexes)
Set whether indexes should be manipulated. |
void |
setMappingWriter(Writer mappingWriter)
The stream to export the planned mappings to as an XML document. |
void |
setPrimaryKeys(boolean pks)
Set whether primary keys should be generated. |
void |
setReadSchema(boolean readSchema)
Set to true to read the entire schema before mapping. |
void |
setReinstallInfo(boolean reinstallInfo)
Whether mappings should be re-installed into the mapping factory on record. |
void |
setRepository(MappingRepository repos)
Set the repository to use to access mapping information. |
void |
setSchemaAction(String schemaAction)
The schema modification policy. |
void |
setSchemaGroup(SchemaGroup schema)
Set the schema to use in mapping. |
void |
setSchemaTool(SchemaTool tool)
Set the schema tool to use for schema modification. |
void |
setSchemaWriter(Writer schemaWriter)
The stream to export the planned schema to as an XML document. |
void |
validate(Class cls)
Validate the mappings for the given class and its fields. |
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_REFRESH
public static final String ACTION_DROP
public static final String ACTION_VALIDATE
public static final String ACTION_REVERT
public static final String ACTION_EXPORT
public static final String ACTION_IMPORT
public static final String ACTION_BUILD_SCHEMA
public static final String[] ACTIONS
Constructor Detail |
public MappingTool(JDBCConfiguration conf)
Method Detail |
public String getSchemaAction()
SchemaTool.ACTION_ADD
SchemaTool.ACTION_REFRESH
SchemaTool.ACTION_RETAIN
SchemaTool.ACTION_BUILD
none
SchemaTool.ACTION_ADD
.public void setSchemaAction(String schemaAction)
SchemaTool.ACTION_ADD
SchemaTool.ACTION_REFRESH
SchemaTool.ACTION_RETAIN
SchemaTool.ACTION_BUILD
none
SchemaTool.ACTION_ADD
.public boolean getReadSchema()
public void setReadSchema(boolean readSchema)
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 boolean getDropUnusedComponents()
SchemaGroup
, and, depending on
the schema action, from the database. Defaults to true.public void setDropUnusedComponents(boolean dropUnused)
SchemaGroup
, and, depending on
the schema action, from the database. Defaults to true.public void setIgnoreErrors(boolean ignoreErrors)
public boolean getIgnoreErrors()
public void setReinstallInfo(boolean reinstallInfo)
public boolean getReinstallInfo()
public SchemaTool getSchemaTool()
public void setSchemaTool(SchemaTool tool)
public Writer getSchemaWriter()
public void setSchemaWriter(Writer schemaWriter)
public Writer getMappingWriter()
public void setMappingWriter(Writer mappingWriter)
public MappingRepository getRepository()
MappingRepository
.public void setRepository(MappingRepository repos)
public SchemaGroup getSchemaGroup()
public void setSchemaGroup(SchemaGroup schema)
public void clear()
record()
.public void record()
public void refresh(Class cls)
public void drop(Class cls)
public void revert(Class cls)
public void validate(Class cls)
public void buildSchema(Class cls)
record()
invocation.public static void main(String[] args) throws IOException, SQLException
Usage: java kodo.jdbc.meta.MappingTool [option]* -action/-a <refresh | drop | validate | buildSchema | revert | import | export> <class name | .java file | .class file | .jdo file>+
Where the following options are recognized.
JDOConfiguration
. Optional.JDBCConfiguration
can be set by
using their names and supplying a value. For example:
-licenseKey adslfja83r3lkadf
export
action.add
, refresh
,
build
, and retain
actions correspond to the same-named actions in the
SchemaTool
. Unless you are running the mapping tool on all
of your persistent types at once, it is strongly recommended that
you use only the add
or build
action.
Otherwise it is possible to drop schema components that are used
by classes you aren't currently running the tool over. The action
defaults to add
.SchemaTool
.SchemaTool
.SchemaGenerator
. This option
is ignored if readSchema
is false.The various actions are as follows.
XMLMappingInfoParser
.file
option.Each class supplied as an argument must have valid JDO metadata.
Examples:
java kodo.jdbc.meta.MappingTool
-action refresh mypackage.jdo
java kodo.jbdc.meta.MappingTool
-action validate Person.java
java kodo.jdbc.meta.MappingTool
-action buildSchema Person.java
java kodo.jbdc.meta.MappingTool
-action drop Person.java
java kodo.jdbc.meta.MappingTool
-file mypackage.mappings -action export
mypackage.jdo
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 mappingWriter, String schemaAction, boolean dropTables, boolean ignoreErrors, boolean readSchema, boolean pks, boolean fks, boolean indexes, Writer schemaWriter, Writer sqlWriter, 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 |