use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class AS400DbmsLanguage 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 DbmsLanguage method getTableCountQueryExpression.
/**
* Get the query Expression for one table of column
*
* @param column
* @param where
* @return
*/
public Expression getTableCountQueryExpression(MetadataTable metadataTable, String where) {
Schema parentSchema = SchemaHelper.getParentSchema(metadataTable);
Catalog parentCatalog = CatalogHelper.getParentCatalog(metadataTable);
if (parentSchema != null) {
parentCatalog = CatalogHelper.getParentCatalog(parentSchema);
}
String schemaName = parentSchema == null ? null : parentSchema.getName();
String catalogName = parentCatalog == null ? null : parentCatalog.getName();
String qualifiedName = this.toQualifiedName(catalogName, schemaName, metadataTable.getName());
Expression queryExpression = CoreFactory.eINSTANCE.createExpression();
String expressionBody = getQuerySql(COUNT_ASTERISK, qualifiedName, where);
queryExpression.setBody(expressionBody);
queryExpression.setLanguage(this.getDbmsName());
return queryExpression;
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class DbmsLanguage method getColumnQueryExpression.
/**
* Get the query Expression for one column
*
* @param column
* @param where
* @return
*/
public Expression getColumnQueryExpression(TdColumn column, String where) {
ModelElement columnSet = ColumnHelper.getColumnOwnerAsColumnSet(column);
Schema parentSchema = SchemaHelper.getParentSchema(columnSet);
Catalog parentCatalog = CatalogHelper.getParentCatalog(columnSet);
if (parentSchema != null) {
parentCatalog = CatalogHelper.getParentCatalog(parentSchema);
}
String schemaName = parentSchema == null ? null : parentSchema.getName();
String catalogName = parentCatalog == null ? null : parentCatalog.getName();
String qualifiedName = this.toQualifiedName(catalogName, schemaName, columnSet.getName());
Expression queryExpression = CoreFactory.eINSTANCE.createExpression();
String expressionBody = getQuerySql(column.getName(), qualifiedName, where);
queryExpression.setBody(expressionBody);
queryExpression.setLanguage(this.getDbmsName());
return queryExpression;
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class DbmsLanguage method getQueryColumnSetWithPrefix.
/**
* move this method from ColumnSetNameHelper.getColumnSetQualifiedName().
*
* @param columnset
* @return
*/
public String getQueryColumnSetWithPrefix(ColumnSet columnset) {
Catalog catalog = getCatalog(columnset);
Schema schema = getSchema(columnset);
String catalogName = null;
String schemaName = null;
if (catalog != null) {
catalogName = catalog.getName();
}
if (schema != null) {
schemaName = schema.getName();
}
return getQualifiedColumnSetName(columnset, catalogName, schemaName);
}
use of orgomg.cwm.resource.relational.Catalog in project tdq-studio-se by Talend.
the class PostgresqlDbmsLanguage 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;
}
Aggregations