Overview | Package | Class | Tree | Deprecated | Index | Help
| 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

## com.solarmetric.rd.kodo.impl.jdbc.schema
Class DBSchemaFactory

    java.lang.Object
      |
      +--com.solarmetric.rd.kodo.impl.jdbc.schema.DBSchemaFactory

All Implemented Interfaces:
  SchemaFactory

public class DBSchemaFactory
extends java.lang.Object
implements SchemaFactory

Factory that uses an XML schema definition stored in the database to record the system schema.

Field Summary
`static java.lang.String` | `ACTION_ADD`
`static java.lang.String` | `ACTION_DROP`

Constructor Summary
`DBSchemaFactory()`

Method Summary
`void` | `dropTable()` Drops the sequence table in the DB.
`com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration` | `getConfiguration()`
`protected java.sql.Connection` | `getConnection()` Return a connection to use.
`com.solarmetric.rd.kodo.impl.jdbc.schema.Column` | `getPKColumn()`
`com.solarmetric.rd.kodo.impl.jdbc.schema.Column` | `getSchemaColumn()`
`static void` | `main(java.lang.String[] args)` Usage: java com.solarmetric.kodo.impl.jdbc.schema.DBSchemaFactory [option]* -action/-a <add | drop>
`com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup` | `readSchema()` Return the schema group for the current object model and database.
`java.lang.String` | `readSchemaColumn()` Returns the schema as an XML string.
`void` | `refreshTable()` Creates the schema table in the DB.
`static boolean` | `run(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf, java.lang.String action)`
`void` | `setConfiguration(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf)` Set the configuration for the factory.
`void` | `storeSchema(com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup schema)` Record the schema group after changes may have been made.
`void` | `writeSchemaColumn(java.lang.String schema)` Writes the schema 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

### ACTION_ADD

    public static final java.lang.String ACTION_ADD

See Also:
  Constant Field Values

### ACTION_DROP

    public static final java.lang.String ACTION_DROP

See Also:
  Constant Field Values

Constructor Detail

### DBSchemaFactory

    public DBSchemaFactory()

Method Detail

### getConfiguration

    public com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration getConfiguration()

### setConfiguration

    public void setConfiguration(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf)

  Description copied from interface: `SchemaFactory`
  Set the configuration for the factory.

  Specified by:
    `setConfiguration` in interface `SchemaFactory`

### getPKColumn

    public com.solarmetric.rd.kodo.impl.jdbc.schema.Column getPKColumn()

### getSchemaColumn

    public com.solarmetric.rd.kodo.impl.jdbc.schema.Column getSchemaColumn()

### readSchema

    public com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup readSchema()

  Description copied from interface: `SchemaFactory`
  Return the schema group for the current object model and database.

  Specified by:
    `readSchema` in interface `SchemaFactory`

### storeSchema

    public void storeSchema(com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGroup schema)

  Description copied from interface: `SchemaFactory`
  Record the schema group after changes may have been made.

  Specified by:
    `storeSchema` in interface `SchemaFactory`
  Parameters:
    `schema` - the schema definition for the entire system

### refreshTable

    public void refreshTable()
                      throws java.sql.SQLException

  Creates the schema table in the DB.

    `java.sql.SQLException`

### dropTable

    public void dropTable()
                   throws java.sql.SQLException

  Drops the sequence table in the DB.

    `java.sql.SQLException`

### readSchemaColumn

    public java.lang.String readSchemaColumn()
                                      throws java.sql.SQLException

  Returns the schema as an XML string.

    `java.sql.SQLException`

### writeSchemaColumn

    public void writeSchemaColumn(java.lang.String schema)
                           throws java.sql.SQLException

  Writes the schema as a string to the database.

    `java.sql.SQLException`

### getConnection

    protected java.sql.Connection getConnection()
                                         throws java.sql.SQLException

  Return a connection to use. The connection will log SQL.

    `java.sql.SQLException`

### main

    public static void main(java.lang.String[] args)
                     throws java.io.IOException,
                            java.sql.SQLException

  Usage: java com.solarmetric.kodo.impl.jdbc.schema.DBSchemaFactory [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 schema table.
  - drop: Drop the schema table.

    `java.io.IOException`
    `java.sql.SQLException`

### run

    public static boolean run(com.solarmetric.rd.kodo.impl.jdbc.conf.JDBCConfiguration conf,
                              java.lang.String action)
                       throws java.io.IOException,
                              java.sql.SQLException

    `java.io.IOException`
    `java.sql.SQLException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| 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

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.