Skip Headers

# Creating Tables With a Table Creator

Previous

Next

After creating a `TableCreator` class (see "Creating a Table Creator"), you can use its API to create and drop tables. The important `TableCreator` methods are as follows (each method takes an instance of `DatabaseSession`):

- `createTables`–this method creates tables, adds constraints, and creates sequence tables and sequences (if sequence tables already exist, this method drops them and recreates them).

- `dropTables`–his method drops all constraints and drops all tables (except sequence tables) that the `TableCreator` defines.

- `createConstraints`–this method creates constraints on all pre-existing tables that the `TableCreator` defines.

- `dropConstraints`–this method drops constraints on all pre-existing tables that the `TableCreator` defines.

- `replaceTables`–this method drops and then creates all tables that the `TableCreator` defines.