Skip Headers

# Understanding the Schema Manager

Previous

Next

Figure: SchemaManager Usage summarizes the important `SchemaManager` classes and the primary means of using them.

SchemaManager Usage

Description of "SchemaManager Usage"

Although you can use the `SchemaManager` API directly, Oracle recommends that you create a `TableCreator` class and use its API (which, in turn, uses the `SchemaManager`).

You can automatically generate a `TableCreator` using:

- TopLink Workbench during development (see "Using TopLink Workbench During Development")

- `DefaultTableGenerator` at run time (see "Using the Default Table Generator at Run Time")

The `TableCreator` class owns one or more `TableDefinition` classes (one for each database table) and the `TableDefinition` class owns one or more `FieldDefinition` classes (one for each field).

The `TableDefinition` class lets you specify a database table schema in a generic format. At run time, TopLink uses the session associated with your TopLink project to determine the specific database type, and uses the generic schema to create the appropriate tables and fields for that database.

After creating a `TableCreator` class, you can use its API to create and drop tables (see "Creating Tables With a Table Creator"). You can also configure TopLink to do this automatically (see "Automatic Database Table Creation").

Because the schema manager uses Java types rather than database types, it is database-independent. However, because it does not account for database-specific optimizations, it is best-suited for development purposes rather than production. For more information on how the schema manager maps Java types to database types, see "Schema Manager Java and Database Type Conversion".

Although the schema manager can handle the sequencing configuration that you specify in your TopLink project, if you are using sequencing with non-Oracle databases, there are some sequencing restrictions you should be aware of (see "Sequencing").