Modifier and Type | Class and Description |
---|---|
static interface |
Schema.Column
Interface or table columns
|
static class |
Schema.DBType
DB types
|
static interface |
Schema.Index
Interface for Index
|
static interface |
Schema.Table
Interface for DB Table
|
Constructor and Description |
---|
Schema() |
Modifier and Type | Method and Description |
---|---|
static String |
generateCreateIndexScript(Schema.Index index,
Schema.DBType dbType)
Generates the SQL statement for creating the Index
|
static String |
generateCreateTableScript(Schema.Table table,
Schema.DBType dbType,
List<Schema.Column> tableColumns)
Generates the SQL Statement for creating the table
|
static String |
generateDropTableScript(Schema.Table table,
Schema.DBType dbType)
Generates the SQL Statement for droping the table
|
static String |
getDbDataType(Schema.Column column,
Schema.DBType dbType)
Returns the appropriate DB type for given column according to the DB Type
|
static boolean |
isHsqlConnection(Connection conn)
Checks if the given connection's driver is HSQL Database Driver
|
static boolean |
isMySqlConnection(Connection conn)
Checks if the given connection's driver is MySQL Database Driver
|
public Schema()
public static String getDbDataType(Schema.Column column, Schema.DBType dbType)
column
- the column that need the typedbType
- the database typepublic static String generateCreateTableScript(Schema.Table table, Schema.DBType dbType, List<Schema.Column> tableColumns)
table
- the table namedbType
- the database typetableColumns
- the columns of the tablepublic static String generateDropTableScript(Schema.Table table, Schema.DBType dbType)
table
- the table namedbType
- the database typepublic static String generateCreateIndexScript(Schema.Index index, Schema.DBType dbType)
index
- the indexdbType
- the database typepublic static boolean isHsqlConnection(Connection conn) throws SQLException
conn
- the connectionSQLException
- if the connection type could not be determinedpublic static boolean isMySqlConnection(Connection conn) throws SQLException
conn
- the connectionSQLException
- if the connection type could not be determinedCopyright © 2018 Apache Software Foundation. All rights reserved.