Search in sources :

Example 1 with InlineSqlModelerSource

use of org.pentaho.platform.dataaccess.datasource.wizard.service.impl.utils.InlineSqlModelerSource in project data-access by pentaho.

the class ModelerService method generateDomain.

// TODO: remove this method in favor so specific calls
@Deprecated
public Domain generateDomain(String connectionName, String tableName, String dbType, String query, String datasourceName) throws Exception {
    initKettle();
    try {
        DatabaseMeta database = AgileHelper.getDatabaseMeta();
        IModelerSource source;
        if (tableName != null) {
            source = new TableModelerSource(database, tableName, null, datasourceName);
        } else {
            source = new InlineSqlModelerSource(connectionName, dbType, query, datasourceName);
        }
        return source.generateDomain();
    } catch (Exception e) {
        logger.error(e);
        throw new Exception(e.getLocalizedMessage());
    }
}
Also used : TableModelerSource(org.pentaho.agilebi.modeler.util.TableModelerSource) InlineSqlModelerSource(org.pentaho.platform.dataaccess.datasource.wizard.service.impl.utils.InlineSqlModelerSource) IModelerSource(org.pentaho.agilebi.modeler.IModelerSource) DatabaseMeta(org.pentaho.di.core.database.DatabaseMeta) KettleException(org.pentaho.di.core.exception.KettleException)

Aggregations

IModelerSource (org.pentaho.agilebi.modeler.IModelerSource)1 TableModelerSource (org.pentaho.agilebi.modeler.util.TableModelerSource)1 DatabaseMeta (org.pentaho.di.core.database.DatabaseMeta)1 KettleException (org.pentaho.di.core.exception.KettleException)1 InlineSqlModelerSource (org.pentaho.platform.dataaccess.datasource.wizard.service.impl.utils.InlineSqlModelerSource)1