use of net.sourceforge.squirrel_sql.fw.sql.TableColumnInfo in project tdi-studio-se by Talend.
the class TableNode method isNodeSameToColumn.
/**
* Check if ColumnNode and Column are the same.
*
* @param node ColumnNode
* @param column MetadataColumnImpl
* @return isNodeSameToColumn
* @exception
*/
private boolean isNodeSameToColumn(ColumnNode node, MetadataColumnImpl column) {
SessionTreeNode sessionTreeNode = node.getSession();
TableColumnInfo[] tableColumnInfo = null;
try {
tableColumnInfo = sessionTreeNode.getMetaData().getColumnInfo(ptableInfo);
} catch (SQLException e) {
SqlBuilderPlugin.log(e.getMessage(), e);
return false;
}
// Retrive metadataColumns from Database
IMetadataConnection iMetadataConnection = ConvertionHelper.convert(connection);
List<TdColumn> metadataColumns = new ArrayList<TdColumn>();
metadataColumns = ExtractMetaDataFromDataBase.returnMetadataColumnsFormTable(iMetadataConnection, getLabelText());
Iterator iterate = metadataColumns.iterator();
while (iterate.hasNext()) {
MetadataColumn metadataColumn = (MetadataColumn) iterate.next();
for (TableColumnInfo info : tableColumnInfo) {
if (metadataColumn.getLabel().equals(node.getLabelText()) && info.getColumnName().equals(node.getLabelText())) {
boolean divergency = isEquivalent(metadataColumn, column);
metadataColumn.setDivergency(divergency);
return divergency;
}
}
}
return true;
}
Aggregations