|
Kodo 4.2.0. generated on July 28 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.meta.AbstractMetaDataFactory kodo.jdo.jdbc.TableJDORMappingFactory
public class TableJDORMappingFactory
Plugin to load and store JDO mapping data in a database table.
This should be combined with a standard MetaDataFactory
in a
MetaDataPlusMappingFactory
.
Field Summary | |
---|---|
static String |
ACTION_ADD
|
static String |
ACTION_DROP
|
static int |
TYPE_CLASS
|
static int |
TYPE_CLASS_QUERY
|
static int |
TYPE_QUERY
|
static int |
TYPE_SEQUENCE
|
Fields inherited from class org.apache.openjpa.meta.AbstractMetaDataFactory |
---|
dir, log, repos, store, strict, types |
Fields inherited from interface org.apache.openjpa.meta.MetaDataFactory |
---|
STORE_DEFAULT, STORE_PER_CLASS, STORE_VERBOSE |
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes |
---|
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY |
Constructor Summary | |
---|---|
TableJDORMappingFactory()
|
Method Summary | |
---|---|
void |
clear()
|
int |
deleteMappingRow(String name,
int type,
boolean startsWith)
Delete the row with the given name and type values. |
boolean |
drop(Class[] cls,
int mode,
ClassLoader envLoader)
|
void |
dropTable()
Drops the mapping table in the DB. |
void |
endConfiguration()
|
boolean |
getConstraintNames()
Whether to write out constraint names in generated mapping data. |
MetaDataDefaults |
getDefaults()
|
String |
getMappingColumn()
The name of the mapping column on the mapping definition table. |
String |
getNameColumn()
The name of the name on the mapping table. |
JDORMetaDataParser |
getParser()
Return metadata parser, creating it if it does not already exist. |
String |
getTable()
The name of the mapping definition table. |
String |
getTypeColumn()
The name of the type column on the mapping definition table. |
void |
load(Class cls,
int mode,
ClassLoader envLoader)
|
void |
loadXMLMetaData(FieldMetaData fieldMetaData)
|
static void |
main(String[] args)
Usage: java kodo.jdbc.meta.TableJDORMappingFactory [option]* -action/-a <add | drop> |
List |
readMappingColumn(String name,
int type,
boolean startsWith)
Returns the mapping column data for the given class. |
void |
refreshTable()
Creates the schema table in the DB. |
static boolean |
run(JDBCConfiguration conf,
String action)
Run the tool. |
static boolean |
run(JDBCConfiguration conf,
String[] args,
Options opts)
Run the tool. |
void |
setConfiguration(Configuration conf)
|
void |
setConstraintNames(boolean cnames)
Whether to write out constraint names in generated mapping data. |
void |
setMappingColumn(String name)
The name of the mapping column on the mapping definition table. |
void |
setNameColumn(String name)
The name of the name on the mapping table. |
void |
setParser(JDORMetaDataParser parser)
Set the metadata parser. |
void |
setTable(String name)
The name of the schema definition table. |
void |
setTypeColumn(String name)
The name of the type column on the mapping definition table. |
void |
setUseSchemaValidation(boolean useSchema)
Whether to use XSD schema validation (as opposed to DTD). |
void |
startConfiguration()
|
boolean |
store(ClassMetaData[] metas,
QueryMetaData[] queries,
SequenceMetaData[] seqs,
int mode,
Map output)
|
boolean |
useSchemaValidation()
Whether to use XSD schema validation (as opposed to DTD). |
void |
writeMappingColumn(String name,
int type,
String mapping)
Writes the mapping as a string to the database. |
Methods inherited from class org.apache.openjpa.meta.AbstractMetaDataFactory |
---|
addClassExtensionKeys, addFieldExtensionKeys, getPersistentTypeNames, getQueryScope, getResultSetMappingScope, newClassArgParser, setRepository, setStoreDirectory, setStoreMode, setStrict, setTypes, setTypes |
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 int TYPE_CLASS
public static final int TYPE_SEQUENCE
public static final int TYPE_QUERY
public static final int TYPE_CLASS_QUERY
Constructor Detail |
---|
public TableJDORMappingFactory()
Method Detail |
---|
public String getTable()
KODO_JDO_MAPPINGS
.
public void setTable(String name)
KODO_JDO_MAPPINGS
.
public void setNameColumn(String name)
NAME
.
public String getNameColumn()
NAME
.
public void setMappingColumn(String name)
MAPPING_DEF
.
public String getMappingColumn()
MAPPING_DEF
.
public void setTypeColumn(String name)
MAPPING_TYPE
.
public String getTypeColumn()
MAPPING_TYPE
.
public boolean getConstraintNames()
public void setConstraintNames(boolean cnames)
public boolean useSchemaValidation()
public void setUseSchemaValidation(boolean useSchema)
public JDORMetaDataParser getParser()
public void setParser(JDORMetaDataParser parser)
public void clear()
clear
in interface MetaDataFactory
clear
in class AbstractMetaDataFactory
public void loadXMLMetaData(FieldMetaData fieldMetaData)
loadXMLMetaData
in interface MetaDataFactory
public void load(Class cls, int mode, ClassLoader envLoader)
load
in interface MetaDataFactory
public boolean store(ClassMetaData[] metas, QueryMetaData[] queries, SequenceMetaData[] seqs, int mode, Map output)
store
in interface MetaDataFactory
store
in class AbstractMetaDataFactory
public boolean drop(Class[] cls, int mode, ClassLoader envLoader)
drop
in interface MetaDataFactory
drop
in class AbstractMetaDataFactory
public MetaDataDefaults getDefaults()
getDefaults
in interface MetaDataFactory
public void refreshTable() throws SQLException
SQLException
public void dropTable() throws SQLException
SQLException
public List readMappingColumn(String name, int type, boolean startsWith) throws SQLException
SQLException
public void writeMappingColumn(String name, int type, String mapping) throws SQLException
SQLException
public int deleteMappingRow(String name, int type, boolean startsWith) throws SQLException
SQLException
public void setConfiguration(Configuration conf)
setConfiguration
in interface Configurable
public void startConfiguration()
startConfiguration
in interface Configurable
public void endConfiguration()
endConfiguration
in interface Configurable
public static void main(String[] args) throws IOException, SQLException
Usage: java kodo.jdbc.meta.TableJDORMappingFactory [option]* -action/-a <add | drop>
Where the following options are recognized.
JDBCConfiguration
. Optional.JDBCConfiguration
can be set by
using their names and supplying a value. For example:
-connectionDriverName oracle.jdbc.driver.OracleDriver
The various actions are as follows.
IOException
SQLException
public static boolean run(JDBCConfiguration conf, String[] args, Options opts) throws IOException, SQLException
IOException
SQLException
main(java.lang.String[])
public static boolean run(JDBCConfiguration conf, String action) throws IOException, SQLException
IOException
SQLException
|
Kodo 4.2.0. generated on July 28 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |