Overview | Package | Class | Tree | Deprecated | Index | Help
| Kodo 4.1.0 generated on October 9 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## kodo.jdo.jdbc
Class TableJDORMappingFactory

    java.lang.Object
      org.apache.openjpa.meta.AbstractMetaDataFactory
          kodo.jdo.jdbc.TableJDORMappingFactory

All Implemented Interfaces:
  org.apache.openjpa.lib.conf.Configurable, org.apache.openjpa.meta.MetaDataFactory, org.apache.openjpa.meta.MetaDataModes

    public class TableJDORMappingFactory

extends org.apache.openjpa.meta.AbstractMetaDataFactory
implements org.apache.openjpa.lib.conf.Configurable

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_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.
`org.apache.openjpa.meta.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.
`kodo.jdo.jdbc.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)`
`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(org.apache.openjpa.jdbc.conf.JDBCConfiguration conf, String action)` Run the tool.
`static boolean` | `run(org.apache.openjpa.jdbc.conf.JDBCConfiguration conf, String[] args, org.apache.openjpa.lib.util.Options opts)` Run the tool.
`void` | `setConfiguration(org.apache.openjpa.lib.conf.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(kodo.jdo.jdbc.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(org.apache.openjpa.meta.ClassMetaData[] metas, org.apache.openjpa.meta.QueryMetaData[] queries, org.apache.openjpa.meta.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, 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

### ACTION_ADD

    public static final String ACTION_ADD

See Also:
  Constant Field Values

### ACTION_DROP

    public static final String ACTION_DROP

See Also:
  Constant Field Values

### TYPE_CLASS

    public static final int TYPE_CLASS

See Also:
  Constant Field Values

### TYPE_SEQUENCE

    public static final int TYPE_SEQUENCE

See Also:
  Constant Field Values

### TYPE_QUERY

    public static final int TYPE_QUERY

See Also:
  Constant Field Values

### TYPE_CLASS_QUERY

    public static final int TYPE_CLASS_QUERY

See Also:
  Constant Field Values

Constructor Detail

### TableJDORMappingFactory

    public TableJDORMappingFactory()

Method Detail

### getTable

    public String getTable()

  The name of the mapping definition table. Defaults to `KODO_JDO_MAPPINGS`.

### setTable

    public void setTable(String name)

  The name of the schema definition table. Defaults to `KODO_JDO_MAPPINGS`.

### setNameColumn

    public void setNameColumn(String name)

  The name of the name on the mapping table. Defaults to `NAME`.

### getNameColumn

    public String getNameColumn()

  The name of the name on the mapping table. Defaults to `NAME`.

### setMappingColumn

    public void setMappingColumn(String name)

  The name of the mapping column on the mapping definition table. Defaults to `MAPPING_DEF`.

### getMappingColumn

    public String getMappingColumn()

  The name of the mapping column on the mapping definition table. Defaults to `MAPPING_DEF`.

### setTypeColumn

    public void setTypeColumn(String name)

  The name of the type column on the mapping definition table. Defaults to `MAPPING_TYPE`.

### getTypeColumn

    public String getTypeColumn()

  The name of the type column on the mapping definition table. Defaults to `MAPPING_TYPE`.

### getConstraintNames

    public boolean getConstraintNames()

  Whether to write out constraint names in generated mapping data. Defaults to false.

### setConstraintNames

    public void setConstraintNames(boolean cnames)

  Whether to write out constraint names in generated mapping data. Defaults to false.

### useSchemaValidation

    public boolean useSchemaValidation()

  Whether to use XSD schema validation (as opposed to DTD). Defaults to false.

### setUseSchemaValidation

    public void setUseSchemaValidation(boolean useSchema)

  Whether to use XSD schema validation (as opposed to DTD). Defaults to false.

### getParser

    public kodo.jdo.jdbc.JDORMetaDataParser getParser()

  Return metadata parser, creating it if it does not already exist.

### setParser

    public void setParser(kodo.jdo.jdbc.JDORMetaDataParser parser)

  Set the metadata parser.

### clear

    public void clear()

  Specified by:
    `clear` in interface `org.apache.openjpa.meta.MetaDataFactory`
  Overrides:
    `clear` in class `org.apache.openjpa.meta.AbstractMetaDataFactory`

### load

    public void load(Class cls,
                     int mode,
                     ClassLoader envLoader)

  Specified by:
    `load` in interface `org.apache.openjpa.meta.MetaDataFactory`

### store

    public boolean store(org.apache.openjpa.meta.ClassMetaData[] metas,
                         org.apache.openjpa.meta.QueryMetaData[] queries,
                         org.apache.openjpa.meta.SequenceMetaData[] seqs,
                         int mode,
                         Map output)

  Specified by:
    `store` in interface `org.apache.openjpa.meta.MetaDataFactory`
  Overrides:
    `store` in class `org.apache.openjpa.meta.AbstractMetaDataFactory`

### drop

    public boolean drop(Class[] cls,
                        int mode,
                        ClassLoader envLoader)

  Specified by:
    `drop` in interface `org.apache.openjpa.meta.MetaDataFactory`
  Overrides:
    `drop` in class `org.apache.openjpa.meta.AbstractMetaDataFactory`

### getDefaults

    public org.apache.openjpa.meta.MetaDataDefaults getDefaults()

  Specified by:
    `getDefaults` in interface `org.apache.openjpa.meta.MetaDataFactory`

### refreshTable

    public void refreshTable()
                      throws SQLException

  Creates the schema table in the DB.

  Throws:
    `SQLException`

### dropTable

    public void dropTable()
                   throws SQLException

  Drops the mapping table in the DB.

  Throws:
    `SQLException`

### readMappingColumn

    public List readMappingColumn(String name,
                                  int type,
                                  boolean startsWith)
                           throws SQLException

  Returns the mapping column data for the given class.

  Throws:
    `SQLException`

### writeMappingColumn

    public void writeMappingColumn(String name,
                                   int type,
                                   String mapping)
                            throws SQLException

  Writes the mapping as a string to the database.

  Throws:
    `SQLException`

### deleteMappingRow

    public int deleteMappingRow(String name,
                                int type,
                                boolean startsWith)
                         throws SQLException

  Delete the row with the given name and type values.

  Returns:
    the update count
  Throws:
    `SQLException`

### setConfiguration

    public void setConfiguration(org.apache.openjpa.lib.conf.Configuration conf)

  Specified by:
    `setConfiguration` in interface `org.apache.openjpa.lib.conf.Configurable`

### startConfiguration

    public void startConfiguration()

  Specified by:
    `startConfiguration` in interface `org.apache.openjpa.lib.conf.Configurable`

### endConfiguration

    public void endConfiguration()

  Specified by:
    `endConfiguration` in interface `org.apache.openjpa.lib.conf.Configurable`

### main

    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.

  - -properties/-p <properties file or resource>: The path or resource name of a Kodo properties file containing information such as the license key and connection data as outlined in `JDBCConfiguration`. Optional.
  - -<property name> <property value>: All bean properties of the Kodo `JDBCConfiguration` can be set by using their names and supplying a value. For example: `-licenseKey adslfja83r3lkadf`

  The various actions are as follows.

  - add: Create the mapping table.
  - drop: Drop the mapping table.

  Throws:
    `IOException`
    `SQLException`

### run

    public static boolean run(org.apache.openjpa.jdbc.conf.JDBCConfiguration conf,
                              String[] args,
                              org.apache.openjpa.lib.util.Options opts)
                       throws IOException,
                              SQLException

  Run the tool. Returns false if invalid options were given.

  Throws:
    `IOException`
    `SQLException`
  See Also:
    `main(java.lang.String[])`

### run

    public static boolean run(org.apache.openjpa.jdbc.conf.JDBCConfiguration conf,
                              String action)
                       throws IOException,
                              SQLException

  Run the tool.

  Throws:
    `IOException`
    `SQLException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Kodo 4.1.0 generated on October 9 2006
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001-2006 BEA Systems, Inc. All Rights Reserved.