use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class DataProviderComparisonLevel method isCatalogOrSchema.
/**
* if it has only catalog or only schema(like as:yes for mysql and oracle,no for MSSQL SEVER ).
*
* @param obj
* @return
*/
private boolean isCatalogOrSchema(EObject obj) {
Catalog cat = SwitchHelpers.CATALOG_SWITCH.doSwitch(obj);
if (cat != null) {
return true;
}
Schema schema = SwitchHelpers.SCHEMA_SWITCH.doSwitch(obj);
if (schema != null) {
return true;
}
return false;
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class DataExplorer method getFullyQualifiedTableName.
/**
* DOC bZhou Comment method "getFullyQualifiedTableName".
*
* @param set
* @return
*/
protected String getFullyQualifiedTableName(ColumnSet set) {
Schema parentSchema = SchemaHelper.getParentSchema(set);
Catalog parentCatalog = CatalogHelper.getParentCatalog(set);
if (parentSchema != null) {
parentCatalog = CatalogHelper.getParentCatalog(parentSchema);
}
String schemaName = parentSchema == null ? null : parentSchema.getName();
String catalogName = parentCatalog == null ? null : parentCatalog.getName();
return dbmsLanguage.toQualifiedName(catalogName, schemaName, set.getName());
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class CatalogAnalysisDPSelectionPage method addListeners.
@Override
protected void addListeners() {
addListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
Object object = ((IStructuredSelection) event.getSelection()).getFirstElement();
if (object instanceof Catalog) {
advanceToNextPageOrFinish();
}
}
});
addListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
try {
Object object = ((IStructuredSelection) event.getSelection()).getFirstElement();
PackagesAnalyisParameter catalogPanameter = (PackagesAnalyisParameter) getConnectionParams();
List<IRepositoryNode> nodes = new ArrayList<IRepositoryNode>();
if (object instanceof DBCatalogRepNode) {
DBCatalogRepNode catalogNode = (DBCatalogRepNode) object;
Catalog catalog = ((MetadataCatalogRepositoryObject) catalogNode.getObject()).getCatalog();
Connection tdProvider = ConnectionHelper.getTdDataProvider(SwitchHelpers.PACKAGE_SWITCH.doSwitch(catalog));
nodes.add(catalogNode);
if (tdProvider != null && catalogPanameter != null) {
catalogPanameter.setTdDataProvider(tdProvider);
catalogPanameter.setConnectionRepNode((DBConnectionRepNode) catalogNode.getParent());
catalogPanameter.setPackages(nodes);
}
setPageComplete(true);
} else {
setPageComplete(false);
}
} catch (Exception e) {
log.error(e, e);
}
}
});
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class DBSchemaRepNode method createParentNode.
/**
* create the node of parent.
*
* @param object
* @return
*/
private RepositoryNode createParentNode() {
RepositoryNode dbParentRepNode = null;
Package parentPackage = PackageHelper.getParentPackage(getSchema());
if (parentPackage == null) {
dbParentRepNode = new DBConnectionRepNode(getParentViewObject(), null, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
} else if (parentPackage instanceof Catalog) {
dbParentRepNode = DQRepNodeCreateFactory.createDBCatalogRepNode(getParentViewObject(), null, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
}
return dbParentRepNode;
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class DBConnectionRepNode method initializedCatalogRepNode.
private void initializedCatalogRepNode(List<IRepositoryNode> nodes, Package pack) {
if (pack instanceof Catalog) {
MetadataCatalogRepositoryObject metadataCatalog = new MetadataCatalogRepositoryObject(getObject(), (Catalog) pack);
RepositoryNode catalogNode = DQRepNodeCreateFactory.createDBCatalogRepNode(metadataCatalog, this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
catalogNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_CATALOG);
catalogNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_CATALOG);
metadataCatalog.setRepositoryNode(catalogNode);
nodes.add(catalogNode);
}
}
Aggregations