Search in sources :

Example 1 with DBSybaseCatalogRepNode

use of org.talend.dq.nodes.DBSybaseCatalogRepNode in project tdq-studio-se by Talend.

the class DQRepNodeCreateFactory method createDBCatalogRepNode.

/**
 * this method is used to create a DBCatalogRepNode. And Sybase is a specal case because we don't create schema
 * level when the version of stdio is lower than 5.0.0.So we will create DBSybaseCatalogRepNode to deal with this
 * special case
 *
 * @param viewObject
 * @param parent parent of repositoryNode
 * @param type
 * @return
 */
public static RepositoryNode createDBCatalogRepNode(IRepositoryViewObject viewObject, RepositoryNode parent, ENodeType type, org.talend.core.model.general.Project inWhichProject) {
    Item databaseItem = viewObject.getProperty().getItem();
    DatabaseConnection dbConnection = (DatabaseConnection) ((DatabaseConnectionItem) databaseItem).getConnection();
    SupportDBUrlType dbTypeByKey = SupportDBUrlType.getDBTypeByKey(dbConnection.getDatabaseType());
    switch(dbTypeByKey == null ? SupportDBUrlType.MYSQLDEFAULTURL : dbTypeByKey) {
        case SYBASEDEFAULTURL:
            return new DBSybaseCatalogRepNode(viewObject, parent, type, inWhichProject);
        default:
            return new DBCatalogRepNode(viewObject, parent, type, inWhichProject);
    }
}
Also used : Item(org.talend.core.model.properties.Item) DatabaseConnectionItem(org.talend.core.model.properties.DatabaseConnectionItem) DBCatalogRepNode(org.talend.dq.nodes.DBCatalogRepNode) DBSybaseCatalogRepNode(org.talend.dq.nodes.DBSybaseCatalogRepNode) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) SupportDBUrlType(org.talend.core.model.metadata.builder.database.dburl.SupportDBUrlType)

Aggregations

DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)1 SupportDBUrlType (org.talend.core.model.metadata.builder.database.dburl.SupportDBUrlType)1 DatabaseConnectionItem (org.talend.core.model.properties.DatabaseConnectionItem)1 Item (org.talend.core.model.properties.Item)1 DBCatalogRepNode (org.talend.dq.nodes.DBCatalogRepNode)1 DBSybaseCatalogRepNode (org.talend.dq.nodes.DBSybaseCatalogRepNode)1