|
SolarMetric Kodo JDO 3.1.6 generated on August 25 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--kodo.jdbc.meta.DBMappingFactory
Factory that uses an XML mapping definition stored in the database to record the system mappings.
| Field Summary | |
static String |
ACTION_ADD
|
static String |
ACTION_CLEAN
|
static String |
ACTION_DROP
|
| Constructor Summary | |
DBMappingFactory()
|
|
| Method Summary | |
void |
addExtensionKeys(Collection exts,
Mapping mapping)
Add any metadata extension keys that this MappingFactory uses to store mapping information. |
void |
clean(ClassLoader loader)
Removes all records stored for non-existant classes. |
boolean |
dropMappings(ClassMetaData[] types)
Delete the given mappings. |
void |
dropTable()
Drops the mapping table in the DB. |
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object. |
Column |
getBKColumn()
|
JDBCConfiguration |
getConfiguration()
|
protected Connection |
getConnection()
Return database connection. |
Column |
getMappingColumn()
|
Column |
getPKColumn()
|
String |
getTableName()
The name of the mapping information table. |
boolean |
isSingleOperation()
Return true if this factory reads and writes all system mappings at once. |
boolean |
isSingleRow()
Whether to use a single row for all mapping data, or to place the data for each class in a separate row. |
static void |
main(String[] args)
Usage: java kodo.jdbc.schema.DBMappingFactory [option]* -action/-a <add | drop | clean> |
void |
readMapping(ClassMetaData type,
MappingInfoRepository repos)
Read the object-relational mapping for the given persistent type and add it to the given repository. |
String |
readMappingColumn(String clsName)
Returns the mapping as an XML string, or null if none. |
void |
refreshTable()
Creates the mapping table in the DB. |
boolean |
revertMappings(ClassMetaData[] types)
Revert the mappings to their last saved state, or return false if any cannot be reverted. |
static boolean |
run(JDBCConfiguration conf,
String[] args,
serp.util.Options opts)
Run the tool. |
static boolean |
run(JDBCConfiguration conf,
String action,
ClassLoader loader)
Run the tool. |
void |
setConfiguration(Configuration conf)
Invoked prior to setting bean properties. |
void |
setSingleRow(boolean singleRow)
Whether to use a single row for all mapping data, or to place the data for each class in a separate row. |
void |
setTableName(String name)
The name of the mapping information table. |
void |
startConfiguration()
Invoked before bean property configuration is begun on this object. |
void |
storeMappings(MappingInfoRepository mappings,
JDOMetaDataRepository repos)
Store any changes made to the given mappings, including their field mappings. |
void |
writeMappingColumn(String clsName,
String mapping,
String lastMapping,
boolean insert)
Writes the mappings as a string to the database. |
| 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_CLEAN
| Constructor Detail |
public DBMappingFactory()
| Method Detail |
public boolean isSingleRow()
public void setSingleRow(boolean singleRow)
public String getTableName()
JDO_MAPPINGS.public void setTableName(String name)
JDO_MAPPINGS.public JDBCConfiguration getConfiguration()
public void setConfiguration(Configuration conf)
ConfigurablesetConfiguration in interface Configurablepublic void startConfiguration()
ConfigurablestartConfiguration in interface Configurablepublic void endConfiguration()
ConfigurableendConfiguration in interface Configurablepublic Column getPKColumn()
public Column getMappingColumn()
public Column getBKColumn()
public boolean isSingleOperation()
MappingFactoryMappingFactory.readMapping(kodo.meta.ClassMetaData, kodo.jdbc.meta.MappingInfoRepository) and MappingFactory.revertMappings(kodo.meta.ClassMetaData[]) calls that pass
in a null meta data argument.isSingleOperation in interface MappingFactory
public void readMapping(ClassMetaData type,
MappingInfoRepository repos)
MappingFactoryreadMapping in interface MappingFactorykodo.jdbc.meta.MappingFactorytype - the type to read mapping information forrepos - add the mapping information to this repository
public void storeMappings(MappingInfoRepository mappings,
JDOMetaDataRepository repos)
MappingFactorystoreMappings in interface MappingFactorykodo.jdbc.meta.MappingFactorymappings - the changed mappingsrepos - can be used to access class metadata if neededpublic boolean revertMappings(ClassMetaData[] types)
MappingFactoryrevertMappings in interface MappingFactorykodo.jdbc.meta.MappingFactorytypes - the types to revertpublic boolean dropMappings(ClassMetaData[] types)
MappingFactorydropMappings in interface MappingFactorykodo.jdbc.meta.MappingFactorytypes - the types to drop
public void addExtensionKeys(Collection exts,
Mapping mapping)
MappingFactoryaddExtensionKeys in interface MappingFactorykodo.jdbc.meta.MappingFactoryexts - the collection to which to add the extension keysmapping - the mapping for which to add the keys
public void refreshTable()
throws SQLException
public void dropTable()
throws SQLException
public String readMappingColumn(String clsName)
throws SQLException
public void writeMappingColumn(String clsName,
String mapping,
String lastMapping,
boolean insert)
throws SQLException
public void clean(ClassLoader loader)
throws SQLException
protected Connection getConnection()
throws SQLException
public static void main(String[] args)
throws IOException,
SQLException
Usage: java kodo.jdbc.schema.DBMappingFactory [option]* -action/-a <add | drop | clean>
Where the following options are recognized.
JDBCConfiguration. Optional.JDBCConfiguration can be set by
using their names and supplying a value. For example:
-licenseKey adslfja83r3lkadfThe various actions are as follows.
Class.forName call.
public static boolean run(JDBCConfiguration conf,
String[] args,
serp.util.Options opts)
throws IOException,
SQLException
public static boolean run(JDBCConfiguration conf,
String action,
ClassLoader loader)
throws SQLException
|
SolarMetric Kodo JDO 3.1.6 generated on August 25 2004 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||