public class SchemaTool extends Object
Constructor and Description |
---|
SchemaTool(String realm,
DatabaseDialect dialect)
Creates a new instance for the given dialect.
|
Modifier and Type | Method and Description |
---|---|
static String |
getJdbcTypeName(int jdbcType)
Generates a type name for the given int constant for a JDBC type defined in
Types . |
List<Table> |
getSchema(Database db)
Reads the DB-schema for the given connection.
|
List<SchemaUpdateAction> |
migrateSchemaTo(Database db,
List<Table> targetSchema,
boolean dropTables)
Generates a list of schema change actions.
|
protected void |
readTableRow(List<Table> tables,
Connection c,
ResultSet rs) |
public SchemaTool(String realm, DatabaseDialect dialect)
realm
- the realm this schema is fordialect
- the dialect to use when generatic schema change actions.public List<Table> getSchema(Database db) throws SQLException
db
- the database to read the schema fromSQLException
- in case of a database errorprotected void readTableRow(List<Table> tables, Connection c, ResultSet rs) throws SQLException
SQLException
public List<SchemaUpdateAction> migrateSchemaTo(Database db, List<Table> targetSchema, boolean dropTables) throws SQLException
Compares the expected target schema to the database connected via the given connection.
db
- the database used to determine the existing schematargetSchema
- the target schema defined by Schema
dropTables
- determines if unknown tables should be dropped or notSQLException
- in case of a database errorCopyright © 2018. All rights reserved.