Package org.apache.empire.db.validation
Class DBModelParser
java.lang.Object
org.apache.empire.db.validation.DBModelParser
- Direct Known Subclasses:
MSSqlDBModelParser,MySQLDBModelParser,OracleDBModelParser
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DBColumnprotected voidaddRelation(String relName, DBRelation.DBReference... references) protected voidprotected voidprotected intcollectColumns(DatabaseMetaData dbMeta) collects column information from database meta data for each tableprotected intcollectColumns(DatabaseMetaData dbMeta, String tablePattern) collects column information from database meta data for whole schemaprotected intcollectForeignKeys(DatabaseMetaData dbMeta) collects foreign key information from database meta dataprotected intcollectForeignKeys(DatabaseMetaData dbMeta, String tablePattern) collects foreign key information from database meta dataprotected intcollectPrimaryKeys(DatabaseMetaData dbMeta) collects primary key information from database meta dataprotected intcollectTablesAndViews(DatabaseMetaData dbMeta, String tablePattern) collects table and view information from database meta dataprotected DBDatabaseprotected Objectprotected doublegetColumnSize(DataType empireType, ResultSet rs) Returns the RemoteDatabase Only available after parseModel() is calledprotected DataTypegetEmpireDataType(int sqlType) protected final DBRowSetprotected final Collection<DBRowSet>protected booleanprotected booleanprotected booleanisSystemTable(String tableName, ResultSet tableMeta) Checks if the tableName belongs to a system or hidden tableprotected booleanvoidparseModel(Connection conn) This method is used to parse the populate the remote databaseprotected voidvoidsetStandardIdentityColumnName(String standardIdentityColumnName) voidsetStandardTimestampColumnName(String standardTimestampColumnName)
-
Field Details
-
log
protected static final org.slf4j.Logger log -
catalog
-
schema
-
remoteName
-
remoteDb
-
tableMap
-
-
Constructor Details
-
DBModelParser
Creates a new Model Checker- Parameters:
catalog- the catalogschema- the schema
-
-
Method Details
-
getCatalog
-
getSchema
-
setStandardIdentityColumnName
-
setStandardTimestampColumnName
-
getDatabase
Returns the RemoteDatabase Only available after parseModel() is called- Returns:
- the remote Database
-
parseModel
This method is used to parse the populate the remote database- Parameters:
conn- the connection for retrieving the remote database metadata
-
populateRemoteDatabase
- Throws:
SQLException
-
isSystemTable
Checks if the tableName belongs to a system or hidden table- Parameters:
tableName- the table nametableMeta- the table meta- Returns:
- true if the table is hidden or false otherwise
-
collectTablesAndViews
protected int collectTablesAndViews(DatabaseMetaData dbMeta, String tablePattern) throws SQLException collects table and view information from database meta data- Parameters:
dbMeta- the database meta datatablePattern- the table pattern- Returns:
- the table and view count
- Throws:
SQLException- thrown if a database access error occurs
-
collectColumns
collects column information from database meta data for each table- Parameters:
dbMeta- the database meta data- Returns:
- the column count
- Throws:
SQLException- thrown if a database access error occurs
-
collectColumns
collects column information from database meta data for whole schema- Parameters:
dbMeta- the database meta datatablePattern- the table pattern- Returns:
- the column count
- Throws:
SQLException- thrown if a database access error occurs
-
collectPrimaryKeys
collects primary key information from database meta data- Parameters:
dbMeta- the database meta data- Returns:
- the primary key count
- Throws:
SQLException- thrown if a database access error occurs
-
collectForeignKeys
collects foreign key information from database meta data- Parameters:
dbMeta- the database meta data- Returns:
- the foreign key count
- Throws:
SQLException- thrown if a database access error occurs
-
collectForeignKeys
collects foreign key information from database meta data- Parameters:
dbMeta- the database meta datatablePattern- the table pattern- Returns:
- the foreign key count
- Throws:
SQLException- thrown if a database access error occurs
-
getTables
-
getTable
-
createRemoteDatabase
-
addTable
-
addView
-
addRelation
-
addColumn
- Throws:
SQLException
-
getColumnSize
- Throws:
SQLException
-
isColumnRequired
- Throws:
SQLException
-
getColumnDefault
- Throws:
SQLException
-
isIdentityColumn
-
isTimestampColumn
-
getEmpireDataType
-