public class MetaDbService extends Object
MetaParams.META_DB_SERVICE| Modifier and Type | Field and Description |
|---|---|
protected boolean |
anyChange
There is a database change
|
protected MetaDatabase |
db
Meta Database from constructor
|
protected StringBuilder |
sql
SQL Buffer
|
protected Statement |
stat
DB Statement for common use
|
| Constructor and Description |
|---|
MetaDbService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
changeIndex(List<MetaIndex> indexes)
5.
|
protected void |
checkKeyWord(String word,
MetaTable table,
Set<String> keywords)
Check the keyword
|
protected void |
checkReportKeywords(Connection conn,
List<MetaTable> tables,
List<MetaColumn> newColumns,
List<MetaIndex> indexes)
1.
|
void |
create(MetaDatabase metaDatabase,
Session session)
Create DB
|
protected void |
createForeignKey(List<MetaColumn> foreignColumns)
6.
|
protected void |
createNewColumn(List<MetaColumn> newColumns,
List<MetaColumn> foreignColumns)
4.
|
protected void |
createSchema(int tableTotalCount,
List<MetaTable> tables,
Connection conn)
2.
|
protected void |
createSequenceTable(boolean createSequenceTable)
7.
|
protected void |
createTable(List<MetaTable> tables,
List<MetaColumn> foreignColumns)
3.
|
protected void |
createTableComments(List<MetaTable> tables)
8.
|
protected void |
createTableComments(List<MetaTable> cTables,
StringBuilder out)
Create table and column comments.
|
protected String |
dbIdentifier(String name,
DatabaseMetaData dmd)
Returns a native database identifirer.
|
protected void |
executeUpdate(Appendable sql,
MetaTable table)
Check missing database table, index, or column
|
protected UjoSequencer |
findFirstSequencer()
Find the first sequence of the database or returns null if no sequence was not found.
|
protected SqlDialect |
getDialect() |
protected SqlDialectEx |
getDialectEx()
Returns an extended dialect
|
StringBuilder |
getSql()
SQL Buffer
|
protected boolean |
initialize(Connection conn)
0.
|
protected boolean |
isAnyChange()
Has the database any change?
|
protected boolean |
isCatalog()
Does the database support a catalog?
The feature supports: MySqlDialect and MSSqlDialect.
|
protected boolean |
isModelChanged(Connection conn,
List<MetaTable> newTables,
List<MetaColumn> newColumns,
List<MetaIndex> newIndexes)
Find database table or columns to modify.
|
protected MetaDatabase db
protected final StringBuilder sql
protected Statement stat
protected boolean anyChange
public void create(MetaDatabase metaDatabase, Session session)
public StringBuilder getSql()
protected boolean isModelChanged(Connection conn, List<MetaTable> newTables, List<MetaColumn> newColumns, List<MetaIndex> newIndexes) throws SQLException
conn - Database connectionnewTables - Output parameternewColumns - Output parameterSQLExceptionprotected String dbIdentifier(String name, DatabaseMetaData dmd) throws SQLException
SQLExceptionprotected boolean initialize(Connection conn) throws Exception
Exceptionprotected void checkReportKeywords(Connection conn, List<MetaTable> tables, List<MetaColumn> newColumns, List<MetaIndex> indexes) throws Exception
Exceptionprotected void createSchema(int tableTotalCount,
List<MetaTable> tables,
Connection conn)
throws SQLException,
IOException
SQLExceptionIOExceptionprotected void createTable(List<MetaTable> tables, List<MetaColumn> foreignColumns) throws Exception
Exceptionprotected void createNewColumn(List<MetaColumn> newColumns, List<MetaColumn> foreignColumns) throws Exception
Exceptionprotected void changeIndex(List<MetaIndex> indexes) throws Exception
Exceptionprotected void createForeignKey(List<MetaColumn> foreignColumns) throws Exception
Exceptionprotected void createSequenceTable(boolean createSequenceTable)
throws Exception
Exceptionprotected void createTableComments(List<MetaTable> tables) throws Exception
Exceptionprotected void createTableComments(List<MetaTable> cTables, StringBuilder out)
protected void checkKeyWord(String word, MetaTable table, Set<String> keywords) throws Exception
Exceptionprotected void executeUpdate(Appendable sql, MetaTable table) throws IllegalStateException, SQLException
IllegalStateExceptionSQLExceptionprotected UjoSequencer findFirstSequencer()
protected boolean isAnyChange()
protected SqlDialect getDialect()
protected SqlDialectEx getDialectEx()
protected final boolean isCatalog()
Copyright 2013, Pavel Ponec