public class Schema extends java.lang.Object
| 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 java.lang.String |
generateCreateIndexScript(Schema.Index index,
Schema.DBType dbType)
Generates the SQL statement for creating the Index
|
static java.lang.String |
generateCreateTableScript(Schema.Table table,
Schema.DBType dbType,
java.util.List<Schema.Column> tableColumns)
Generates the SQL Statement for creating the table
|
static java.lang.String |
generateDropTableScript(Schema.Table table,
Schema.DBType dbType)
Generates the SQL Statement for droping the table
|
static java.lang.String |
getDbDataType(Schema.Column column,
Schema.DBType dbType)
Returns the appropriate DB type for given column according to the DB Type
|
static boolean |
isHsqlConnection(java.sql.Connection conn)
Checks if the given connection's driver is HSQL Database Driver
|
static boolean |
isMySqlConnection(java.sql.Connection conn)
Checks if the given connection's driver is MySQL Database Driver
|
public Schema()
public static java.lang.String getDbDataType(Schema.Column column, Schema.DBType dbType)
column - dbType - public static java.lang.String generateCreateTableScript(Schema.Table table, Schema.DBType dbType, java.util.List<Schema.Column> tableColumns)
table - dbType - tableColumns - public static java.lang.String generateDropTableScript(Schema.Table table, Schema.DBType dbType)
table - dbType - public static java.lang.String generateCreateIndexScript(Schema.Index index, Schema.DBType dbType)
index - dbType - public static boolean isHsqlConnection(java.sql.Connection conn) throws java.sql.SQLException
conn - java.sql.SQLExceptionpublic static boolean isMySqlConnection(java.sql.Connection conn) throws java.sql.SQLException
conn - java.sql.SQLExceptionCopyright © 2019 Apache Software Foundation. All Rights Reserved.