|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.dbreplicator.replication
Class pgMetaDataInfo
java.lang.Objectorg.dbreplicator.replication.MetaDataInfo
org.dbreplicator.replication.pgMetaDataInfo
public class pgMetaDataInfo
- extends MetaDataInfo
This Class gets the connection object of the specified publisher or subscriber and then stores it's metadata information in the DataBaseMetaData object(dbmd). This inforamtion is used for performing different operations on the tables of the publication or subscription and on the columns and constraint.
| Constructor Summary | |
|---|---|
pgMetaDataInfo(java.sql.Connection connection0)
|
|
pgMetaDataInfo(ConnectionPool connectionPool0,
java.lang.String pubsubName)
|
|
| Method Summary | |
|---|---|
void |
addCheckConstraintForExistingTable(java.lang.String schemaName,
java.lang.String tableName,
java.util.TreeMap primConsMap,
AbstractDataBaseHandler dbh)
|
void |
appendUniqueKeyConstraints(java.lang.String schemaName,
java.lang.String tableName,
java.lang.StringBuffer cols)
|
void |
checkParentTablesIncludedInList(java.util.ArrayList givenListOfTables,
java.lang.String schemaName,
java.lang.String tableName)
This method check that the parent table of given table is included or not. |
void |
checkTableExistance(SchemaQualifiedName sname)
Checks the existance of the pericular table in the database. |
void |
checkTableSequenceAccordingForeignKey(java.lang.String schemaName,
java.lang.String tableName,
java.util.ArrayList tableList)
Check the sequence of table according to primary key. |
java.lang.String |
generateColumnsQueryForClientNode(AbstractDataBaseHandler dbh,
int srcVendorType,
java.lang.String schemaName,
java.lang.String tableName,
int tgtVendorType)
Generating a query ---- [ columnName dataType[(size)] [default] [not null] , [ columnName dataType[(size)] [default] [not null] ,...]] |
java.lang.String |
getAppliedConstraints(java.lang.String schemaName,
java.lang.String tableName,
java.util.TreeMap primConsMap)
Gets the sequence of different constraint along with datatype in the query formate. |
java.lang.String |
getAppliedConstraintsForExistingTable(java.lang.String schemaName,
java.lang.String tableName,
java.util.TreeMap primConsMap,
AbstractDataBaseHandler dbh)
|
java.lang.String |
getCatalogName(java.lang.String identifier)
|
java.util.ArrayList |
getChildTables(java.lang.String parentTable)
|
java.util.ArrayList |
getColumnDataTypeInfo(AbstractDataBaseHandler dbh,
java.lang.String schemaName,
java.lang.String tableName)
For each column, its dataype is converted in respective database datatype format in typeinfo then it is set in the dbh, passed to Class ColumnsInfo and it's objects are stored in colInfoList. |
java.util.HashMap |
getColumnsInfo(java.lang.String schemaName,
java.lang.String tableName)
|
java.lang.String |
getExistingTableQuery(AbstractDataBaseHandler dbh,
SchemaQualifiedName sname,
int pubVendorType)
|
java.util.ArrayList |
getExportedTableCols(SchemaQualifiedName repTable)
|
java.util.ArrayList |
getForeignKeyConstraints(java.lang.String schemaName,
java.lang.String tableName)
|
java.lang.Object[] |
getImportedColsOfChildTable(java.lang.String parentTable,
java.lang.String childTable)
|
java.util.ArrayList |
getImportedTables(SchemaQualifiedName schemaQualifiedName,
java.util.List passedSchemaQualifiedNamesList,
DirectedGraph graph,
java.lang.String[] removeCycleTableNames0)
|
java.lang.String |
getSchemaName(java.lang.String identifier)
|
java.lang.String |
getTableName(java.lang.String schematable)
Implemented to handle the casesensitveness of postgreSQL for table and and Schema Name.Method is overrided in pgMetaDataInfo. |
java.lang.String[] |
getTablesHierarchy(java.lang.String[] tableNames)
Return the hierarchy of tables based on parent child relationship. |
void |
setAllColumns(RepTable repTable,
java.lang.String schemaName,
java.lang.String tableName)
|
void |
setPrimaryColumns(RepTable repTable,
java.lang.String schemaName,
java.lang.String tableName)
|
| Methods inherited from class org.dbreplicator.replication.MetaDataInfo |
|---|
getExportedTableColsList, getImportedTablesInfo, setForeignKeyColumns |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
pgMetaDataInfo
public pgMetaDataInfo(ConnectionPool connectionPool0, java.lang.String pubsubName) throws RepException
- Throws:
RepException
pgMetaDataInfo
public pgMetaDataInfo(java.sql.Connection connection0) throws RepException
- Throws:
RepException
| Method Detail |
|---|
checkTableExistance
public void checkTableExistance(SchemaQualifiedName sname) throws RepException
- Description copied from class:
MetaDataInfo - Checks the existance of the pericular table in the database.
- Overrides:
checkTableExistancein classMetaDataInfo
- Throws:
RepException
getTablesHierarchy
public java.lang.String[] getTablesHierarchy(java.lang.String[] tableNames) throws RepException
- Description copied from class:
MetaDataInfo - Return the hierarchy of tables based on parent child relationship.
Parent child relationship depend on Primary key and Foreign Key
Relationship.It first add the parent table in array and after that
child tables.
- Parameters:
tableNames- String[]- Returns:
- String[]
- Throws:
RepException
checkParentTablesIncludedInList
public void checkParentTablesIncludedInList(java.util.ArrayList givenListOfTables, java.lang.String schemaName, java.lang.String tableName) throws RepException
- Description copied from class:
MetaDataInfo - This method check that the parent table of given
table is included or not. If parent table not included
in list then it give the RepException because further
it create the problem in synchronization.
- Parameters:
givenListOfTables- ArrayListschemaName- StringtableName- String- Throws:
RepException
checkTableSequenceAccordingForeignKey
public void checkTableSequenceAccordingForeignKey(java.lang.String schemaName, java.lang.String tableName, java.util.ArrayList tableList) throws RepException
- Description copied from class:
MetaDataInfo - Check the sequence of table according to primary key.
If table are not sorted order then throw the error
It checks that if there is a table with any primary key and some
foreign keys then all the tables of foreign key columns are also
included in the publisher or not.
- Overrides:
checkTableSequenceAccordingForeignKeyin classMetaDataInfo
- Parameters:
schemaName- StringtableName- StringtableList- ArrayList- Throws:
RepException
getColumnDataTypeInfo
public java.util.ArrayList getColumnDataTypeInfo(AbstractDataBaseHandler dbh, java.lang.String schemaName, java.lang.String tableName) throws RepException, java.sql.SQLException
- Description copied from class:
MetaDataInfo - For each column, its dataype is converted in respective database datatype
format in typeinfo then it is set in the dbh, passed to Class ColumnsInfo
and it's objects are stored in colInfoList.
- Overrides:
getColumnDataTypeInfoin classMetaDataInfo
- Returns:
- ArrayList
- Throws:
RepExceptionjava.sql.SQLException
getColumnsInfo
public java.util.HashMap getColumnsInfo(java.lang.String schemaName, java.lang.String tableName) throws RepException, java.sql.SQLException
- Overrides:
getColumnsInfoin classMetaDataInfo
- Throws:
RepExceptionjava.sql.SQLException
generateColumnsQueryForClientNode
public java.lang.String generateColumnsQueryForClientNode(AbstractDataBaseHandler dbh, int srcVendorType, java.lang.String schemaName, java.lang.String tableName, int tgtVendorType) throws RepException
- Description copied from class:
MetaDataInfo - Generating a query ----
[ columnName dataType[(size)] [default] [not null] ,
[ columnName dataType[(size)] [default] [not null] ,...]]
- Overrides:
generateColumnsQueryForClientNodein classMetaDataInfo
- Parameters:
dbh-srcVendorType-schemaName-tableName-tgtVendorType-- Returns:
- String
- Throws:
java.sql.SQLExceptionRepException
getAppliedConstraints
public java.lang.String getAppliedConstraints(java.lang.String schemaName, java.lang.String tableName, java.util.TreeMap primConsMap) throws RepException
- Description copied from class:
MetaDataInfo - Gets the sequence of different constraint along with datatype in the
query formate.
- Overrides:
getAppliedConstraintsin classMetaDataInfo
- Returns:
- String
- Throws:
RepException
getAppliedConstraintsForExistingTable
public java.lang.String getAppliedConstraintsForExistingTable(java.lang.String schemaName, java.lang.String tableName, java.util.TreeMap primConsMap, AbstractDataBaseHandler dbh) throws RepException
- Overrides:
getAppliedConstraintsForExistingTablein classMetaDataInfo
- Throws:
RepException
addCheckConstraintForExistingTable
public void addCheckConstraintForExistingTable(java.lang.String schemaName, java.lang.String tableName, java.util.TreeMap primConsMap, AbstractDataBaseHandler dbh) throws RepException
- Overrides:
addCheckConstraintForExistingTablein classMetaDataInfo
- Throws:
RepException
setPrimaryColumns
public void setPrimaryColumns(RepTable repTable, java.lang.String schemaName, java.lang.String tableName) throws RepException, java.sql.SQLException
- Overrides:
setPrimaryColumnsin classMetaDataInfo
- Throws:
RepExceptionjava.sql.SQLException
getCatalogName
public java.lang.String getCatalogName(java.lang.String identifier)
- Overrides:
getCatalogNamein classMetaDataInfo
getSchemaName
public java.lang.String getSchemaName(java.lang.String identifier)
- Overrides:
getSchemaNamein classMetaDataInfo
getTableName
public java.lang.String getTableName(java.lang.String schematable)
- Description copied from class:
MetaDataInfo - Implemented to handle the casesensitveness of postgreSQL
for table and and Schema Name.Method is overrided in
pgMetaDataInfo.
- Overrides:
getTableNamein classMetaDataInfo
- Parameters:
schematable- String- Returns:
- String
getExistingTableQuery
public java.lang.String getExistingTableQuery(AbstractDataBaseHandler dbh, SchemaQualifiedName sname, int pubVendorType) throws RepException, java.sql.SQLException
- Overrides:
getExistingTableQueryin classMetaDataInfo
- Throws:
RepExceptionjava.sql.SQLException
getChildTables
public java.util.ArrayList getChildTables(java.lang.String parentTable) throws RepException
- Specified by:
getChildTablesin classMetaDataInfo
- Throws:
RepException
getImportedColsOfChildTable
public java.lang.Object[] getImportedColsOfChildTable(java.lang.String parentTable, java.lang.String childTable) throws RepException
- Specified by:
getImportedColsOfChildTablein classMetaDataInfo
- Throws:
RepException
getImportedTables
public java.util.ArrayList getImportedTables(SchemaQualifiedName schemaQualifiedName, java.util.List passedSchemaQualifiedNamesList, DirectedGraph graph, java.lang.String[] removeCycleTableNames0) throws RepException
- Specified by:
getImportedTablesin classMetaDataInfo
- Throws:
RepException
getForeignKeyConstraints
public java.util.ArrayList getForeignKeyConstraints(java.lang.String schemaName, java.lang.String tableName) throws RepException
- Specified by:
getForeignKeyConstraintsin classMetaDataInfo
- Throws:
RepException
appendUniqueKeyConstraints
public void appendUniqueKeyConstraints(java.lang.String schemaName, java.lang.String tableName, java.lang.StringBuffer cols) throws RepException
- Specified by:
appendUniqueKeyConstraintsin classMetaDataInfo
- Throws:
RepException
getExportedTableCols
public java.util.ArrayList getExportedTableCols(SchemaQualifiedName repTable) throws RepException
- Specified by:
getExportedTableColsin classMetaDataInfo
- Throws:
RepException
setAllColumns
public void setAllColumns(RepTable repTable, java.lang.String schemaName, java.lang.String tableName) throws RepException, java.sql.SQLException
- Specified by:
setAllColumnsin classMetaDataInfo
- Throws:
RepExceptionjava.sql.SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||


