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 |
|---|---|
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 |
createSequenceTable(boolean createSequenceTable)
7.
|
protected void |
createSchema(int tableTotalCount,
List<MetaTable> tables,
Connection conn)
2.
|
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 sqlAppendable,
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 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.
|
protected boolean |
initialize(Connection conn)
0.
|
protected boolean |
isAnyChange()
Has the database any change?
|
protected boolean |
isCatalog()
Does the database support a catalog?
|
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 SQLException, IOException, org.ujorm.core.IllegalUjormException
conn - SQLExceptionIOExceptionorg.ujorm.core.IllegalUjormExceptionprotected void checkReportKeywords(Connection conn, List<MetaTable> tables, List<MetaColumn> newColumns, List<MetaIndex> indexes) throws SQLException
SQLExceptionprotected void createSchema(int tableTotalCount,
List<MetaTable> tables,
Connection conn)
throws SQLException,
IOException
SQLExceptionIOExceptionprotected void createTable(List<MetaTable> tables, List<MetaColumn> foreignColumns) throws IOException, SQLException
IOExceptionSQLExceptionprotected void createNewColumn(List<MetaColumn> newColumns, List<MetaColumn> foreignColumns) throws IOException, SQLException
IOExceptionSQLExceptionprotected void changeIndex(List<MetaIndex> indexes) throws SQLException, IOException
SQLExceptionIOExceptionprotected void createForeignKey(List<MetaColumn> foreignColumns) throws IOException, SQLException
IOExceptionSQLExceptionprotected void createSequenceTable(boolean createSequenceTable)
throws SQLException,
IOException
SQLExceptionIOExceptionprotected void createTableComments(List<MetaTable> tables) throws org.ujorm.core.IllegalUjormException
org.ujorm.core.IllegalUjormExceptionprotected void createTableComments(List<MetaTable> cTables, StringBuilder out)
protected void checkKeyWord(String word, MetaTable table, Set<String> keywords) throws org.ujorm.core.IllegalUjormException
org.ujorm.core.IllegalUjormExceptionprotected void executeUpdate(@Nonnull Appendable sqlAppendable, @Nonnull MetaTable table) throws org.ujorm.core.IllegalUjormException, SQLException
sqlAppendable - Single SQL statement where the empty value is ignoredtable - Model of database tableorg.ujorm.core.IllegalUjormException - An runtime exceptionSQLException - SQL exceptionprotected UjoSequencer findFirstSequencer()
protected boolean isAnyChange()
protected SqlDialect getDialect()
protected SqlDialectEx getDialectEx()
protected final boolean isCatalog()
Copyright 2013, Pavel Ponec