public class DBModelChecker extends Object
Constructor and Description |
---|
DBModelChecker() |
Modifier and Type | Method and Description |
---|---|
protected DBTableColumn |
addColumn(DBTable t,
ResultSet rs) |
protected void |
addRelation(String relName,
DBRelation.DBReference... references) |
protected void |
addTable(String tableName) |
protected void |
checkAutoIncColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkBlobColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkBoolColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkCharColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkClobColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkColumnNullable(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkColumnSize(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkColumnType(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkDateColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkDecimalColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkFloatColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkForeignKeys(DBTable table,
DBTable remoteTable,
DBModelErrorHandler handler) |
protected void |
checkIntegerColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
void |
checkModel(DBDatabase db,
Connection conn,
String dbSchema,
DBModelErrorHandler handler)
This method is used to check the database model
|
protected void |
checkPrimaryKey(DBTable table,
DBTable remoteTable,
DBModelErrorHandler handler) |
protected void |
checkTable(DBTable table,
DBModelErrorHandler handler) |
protected void |
checkTextColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkUniqueIdColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler) |
protected void |
checkUnknownColumn(DBColumn column,
DBColumn remoteColumn,
DBModelErrorHandler handler)
empire-db DataType-specific checker
|
protected void |
checkView(DBView view,
Connection conn,
DBModelErrorHandler handler) |
protected void |
collectColumns(DatabaseMetaData dbMeta,
String dbSchema,
String tablePattern)
collects column information from database meta data
|
protected void |
collectForeignKeys(DatabaseMetaData dbMeta,
String dbSchema,
String tablePattern)
collects foreign key information from database meta data
|
protected void |
collectPrimaryKeys(DatabaseMetaData dbMeta,
String dbSchema,
String tablePattern)
collects primary key information from database meta data
|
protected void |
collectTables(DatabaseMetaData dbMeta,
String dbSchema,
String tablePattern)
collects table and view information from database meta data
|
protected DataType |
getEmpireDataType(int sqlType) |
protected String |
getMetaCatalog(String dbSchema) |
protected String |
getMetaSchemaPattern(String dbSchema) |
protected DBTable |
getTable(String tableName) |
protected Collection<DBTable> |
getTables() |
protected boolean |
isSystemTable(String tableName,
ResultSet tableMeta) |
public void checkModel(DBDatabase db, Connection conn, String dbSchema, DBModelErrorHandler handler)
db
- The Empire-db definition to be checkedconn
- A connection to the databasedbSchema
- The database schemahandler
- The DBModelErrorHandler
implementation that is called whenever an error
occursprotected void collectTables(DatabaseMetaData dbMeta, String dbSchema, String tablePattern) throws SQLException
dbMeta
- dbSchema
- SQLException
protected void collectColumns(DatabaseMetaData dbMeta, String dbSchema, String tablePattern) throws SQLException
dbMeta
- dbSchema
- SQLException
protected void collectPrimaryKeys(DatabaseMetaData dbMeta, String dbSchema, String tablePattern) throws SQLException
dbMeta
- dbSchema
- SQLException
protected void collectForeignKeys(DatabaseMetaData dbMeta, String dbSchema, String tablePattern) throws SQLException
dbMeta
- dbSchema
- SQLException
protected void checkTable(DBTable table, DBModelErrorHandler handler)
protected void checkPrimaryKey(DBTable table, DBTable remoteTable, DBModelErrorHandler handler)
protected void checkForeignKeys(DBTable table, DBTable remoteTable, DBModelErrorHandler handler)
protected void checkView(DBView view, Connection conn, DBModelErrorHandler handler)
protected void checkColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkColumnType(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkColumnNullable(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkColumnSize(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkUnknownColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkIntegerColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkAutoIncColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkTextColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkDateColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkCharColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkFloatColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkDecimalColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkBoolColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkBlobColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkClobColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected void checkUniqueIdColumn(DBColumn column, DBColumn remoteColumn, DBModelErrorHandler handler)
protected final Collection<DBTable> getTables()
protected void addTable(String tableName)
protected void addRelation(String relName, DBRelation.DBReference... references)
protected DBTableColumn addColumn(DBTable t, ResultSet rs) throws SQLException
SQLException
protected DataType getEmpireDataType(int sqlType)
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.