use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class InfomixDbmsLanguage method getCatalog.
/*
* (non-Javadoc)
*
* @see org.talend.dq.dbms.DbmsLanguage#getCatalog(orgomg.cwm.objectmodel.core.ModelElement)
*/
@Override
protected Catalog getCatalog(ModelElement columnSetOwner) {
// get the schema first
Schema schema = getSchema(columnSetOwner);
// get the catalog according to the schema
Catalog catalog = super.getCatalog(schema);
return catalog;
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class SybaseASEDbmsLanguage method getCatalog.
/*
* (non-Javadoc)
*
* @see org.talend.dq.dbms.DbmsLanguage#getCatalog(orgomg.cwm.objectmodel.core.ModelElement)
*/
@Override
protected Catalog getCatalog(ModelElement columnSetOwner) {
// get the schema first
Schema schema = getSchema(columnSetOwner);
// get the catalog according to the schema
Catalog catalog = super.getCatalog(schema);
return catalog;
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class DQStructureComparer method clearSubNode.
public static void clearSubNode(ModelElement needReloadElement) {
Connection dataProvider = SwitchHelpers.CONNECTION_SWITCH.doSwitch(needReloadElement);
if (dataProvider != null) {
List<Catalog> tdCatalogs = ConnectionHelper.getCatalogs(dataProvider);
for (Catalog catalog : tdCatalogs) {
clearSubNode(catalog);
}
List<Schema> tdSchemas = ConnectionHelper.getSchema(dataProvider);
for (Schema schema : tdSchemas) {
clearSubNode(schema);
}
return;
}
Catalog tdCatalog = SwitchHelpers.CATALOG_SWITCH.doSwitch(needReloadElement);
if (tdCatalog != null) {
List<Schema> schemas = CatalogHelper.getSchemas(tdCatalog);
for (Schema schema : schemas) {
clearSubNode(schema);
}
if (schemas.size() == 0) {
tdCatalog.getOwnedElement().clear();
}
return;
}
Schema tdSchema = SwitchHelpers.SCHEMA_SWITCH.doSwitch(needReloadElement);
if (tdSchema != null) {
tdSchema.getOwnedElement().clear();
return;
}
ColumnSet columnSet = SwitchHelpers.COLUMN_SET_SWITCH.doSwitch(needReloadElement);
if (columnSet != null) {
columnSet.getFeature().clear();
columnSet.getTaggedValue().clear();
// ~MOD mzhao 2009-03-12 Clear primary key(contains in ownedElement)
// as well. If not clear, it will cause
// exception: not contained in
// a resource...
columnSet.getOwnedElement().clear();
return;
}
TdColumn column = SwitchHelpers.COLUMN_SWITCH.doSwitch(needReloadElement);
if (column != null) {
column.getTaggedValue().clear();
// ~MOD mzhao 2009-03-12 Clear primary key as well. If not clear, it
// will cause exception: not contained in
// a resource...
column.getUniqueKey().clear();
// ~
// ~MOD mzhao 2009-04-08 Clear foreign key.
column.getKeyRelationship().clear();
return;
}
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class DQStructureComparer method findMatchedPackage.
/**
* Find the matched package of matchDataProvider.
*
* @param selectedPackage
* @param matchDataProvider
* @return
* @throws ReloadCompareException
*/
public static Package findMatchedPackage(Package selectedPackage, Connection matchDataProvider) throws ReloadCompareException {
// code clean by gdbu 2011-4-18 : when conn is null , throw a ReloadCompareException.
if (null == matchDataProvider) {
// $NON-NLS-1$
throw new ReloadCompareException(DefaultMessagesImpl.getString("DQStructureComparer.ConnectionIsNull"));
}
// code clean
Catalog catalogCase = SwitchHelpers.CATALOG_SWITCH.doSwitch(selectedPackage);
if (catalogCase != null) {
return findMatchedCatalogObj(catalogCase, matchDataProvider);
} else {
Schema schemaCase = (Schema) selectedPackage;
Catalog parentCatalog = CatalogHelper.getParentCatalog(schemaCase);
if (parentCatalog != null) {
Catalog matchCatalog = findMatchedCatalogObj(parentCatalog, matchDataProvider);
List<Schema> schemas = CatalogHelper.getSchemas(matchCatalog);
return findMatchedSchema(schemaCase, schemas);
} else {
List<Schema> schemas = ConnectionHelper.getSchema(matchDataProvider);
return findMatchedSchema(schemaCase, schemas);
}
}
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class CatalogComparisonLevel method reloadElementOfPackage.
private List<Schema> reloadElementOfPackage(Package toReloadObj) throws ReloadCompareException {
List<Schema> schemas = new ArrayList<Schema>();
Catalog catalogObj = SwitchHelpers.CATALOG_SWITCH.doSwitch(toReloadObj);
if (catalogObj != null) {
schemas = CatalogHelper.getSchemas(catalogObj);
}
return schemas;
}
Aggregations