当前位置: 首页>>代码示例>>Java>>正文


Java LogicalModel.getLogicalTables方法代码示例

本文整理汇总了Java中org.pentaho.metadata.model.LogicalModel.getLogicalTables方法的典型用法代码示例。如果您正苦于以下问题:Java LogicalModel.getLogicalTables方法的具体用法?Java LogicalModel.getLogicalTables怎么用?Java LogicalModel.getLogicalTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.metadata.model.LogicalModel的用法示例。


在下文中一共展示了LogicalModel.getLogicalTables方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUniqueLogicalTables

import org.pentaho.metadata.model.LogicalModel; //导入方法依赖的package包/类
/**
 * Get a list of all unique physical table names wrapped in their logical tables
 * @return
 */
protected List<LogicalTable> getUniqueLogicalTables() {
  List<LogicalTable> tables = new ArrayList<LogicalTable>();
  List<String> phTabs = new ArrayList<String>();
  for (LogicalModel model : domain.getLogicalModels()) {
    for (LogicalTable table : model.getLogicalTables()) {
      String phTable = ConceptUtil.getString(table, DefaultIDs.LOGICAL_TABLE_PHYSICAL_TABLE_NAME);
      if (!Const.isEmpty(phTable)) {
        if (!phTabs.contains(phTable)) {
          phTabs.add(phTable);
          tables.add(table);
        }
      }
    }
  }
  
  return tables;
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:22,代码来源:JobGenerator.java

示例2: getUniqueLogicalTables

import org.pentaho.metadata.model.LogicalModel; //导入方法依赖的package包/类
/**
 * Get a list of all unique physical table names wrapped in their logical tables
 * @return
 */
protected List<LogicalTable> getUniqueLogicalTables() {
  List<LogicalTable> tables = new ArrayList<LogicalTable>();
  List<String> phTabs = new ArrayList<String>();
  for (LogicalModel model : domain.getLogicalModels()) {
    for (LogicalTable table : model.getLogicalTables()) {
      String phTable = ConceptUtil.getString(table, DefaultIDs.LOGICAL_TABLE_PHYSICAL_TABLE_NAME);
      if (!Utils.isEmpty(phTable)) {
        if (!phTabs.contains(phTable)) {
          phTabs.add(phTable);
          tables.add(table);
        }
      }
    }
  }

  return tables;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:22,代码来源:JobGenerator.java

示例3: populateElement

import org.pentaho.metadata.model.LogicalModel; //导入方法依赖的package包/类
private static IMetaStoreElement populateElement(IMetaStore metaStore, LogicalModel model) throws MetaStoreException {
  try {
    IMetaStoreElement element = metaStore.newElement();
    element.setName(model.getName(defaultLocale));
    element.addChild( metaStore.newAttribute(Attribute.ID_MODEL_DESCRIPTION.id, model.getDescription(defaultLocale)) );

    IMetaStoreAttribute logicalTablesAttribute = metaStore.newAttribute(Attribute.ID_LOGICAL_TABLES.id, model.getDescription(defaultLocale));
    element.addChild(logicalTablesAttribute);
    for (LogicalTable logicalTable : model.getLogicalTables()) {

      IMetaStoreAttribute logicalTableAttribute = metaStore.newAttribute(Attribute.ID_LOGICAL_TABLE.id, model.getDescription(defaultLocale));
      logicalTablesAttribute.addChild(logicalTableAttribute);

      //

      // Save the ID as well as the name (for safety)
      //
      logicalTableAttribute.addChild(metaStore.newAttribute(Attribute.ID_LOGICAL_TABLE_ID.id, logicalTable.getId()));
      logicalTableAttribute.addChild(metaStore.newAttribute(Attribute.ID_LOGICAL_TABLE_NAME.id, logicalTable.getName()));
    }

    return element;
  } catch(Exception e) {
    throw new MetaStoreException("Unable to populate metastore element from logical model", e);
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:ModelMetaStoreUtil.java

示例4: findLogicalTables

import org.pentaho.metadata.model.LogicalModel; //导入方法依赖的package包/类
public static List<LogicalTable> findLogicalTables(LogicalModel logicalModel, TableType tableType) {
  List<LogicalTable> logicalColumns = new ArrayList<LogicalTable>();
  for (LogicalTable logicalTable : logicalModel.getLogicalTables()) {
    TableType type = getTableType(logicalTable);
    if (type == tableType) {
      logicalColumns.add(logicalTable); 
    }
  }
  return logicalColumns;
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:11,代码来源:ConceptUtil.java

示例5: findDimensionWithName

import org.pentaho.metadata.model.LogicalModel; //导入方法依赖的package包/类
public static LogicalTable findDimensionWithName(LogicalModel logicalModel, String dimensionName, String locale) {
  for (LogicalTable table : logicalModel.getLogicalTables()) {
    TableType tableType = ConceptUtil.getTableType(table);
    if (tableType==TableType.DIMENSION) {
      String name = ConceptUtil.getName(table, locale);
      if (name!=null && name.equalsIgnoreCase(dimensionName)) return table;
    }
  }
  return null;
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:11,代码来源:ConceptUtil.java

示例6: findLogicalTables

import org.pentaho.metadata.model.LogicalModel; //导入方法依赖的package包/类
public static List<LogicalTable> findLogicalTables(LogicalModel logicalModel, TableType tableType) {
  List<LogicalTable> logicalColumns = new ArrayList<LogicalTable>();
  for (LogicalTable logicalTable : logicalModel.getLogicalTables()) {
    TableType type = getTableType(logicalTable);
    if (type == tableType) {
      logicalColumns.add(logicalTable);
    }
  }
  return logicalColumns;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:11,代码来源:ConceptUtil.java

示例7: generatePhysicalMetadataModel

import org.pentaho.metadata.model.LogicalModel; //导入方法依赖的package包/类
public Domain generatePhysicalMetadataModel() throws KettleException {
  
  // First do some checking and lookups...
  //
  String targetDatabaseName = ConceptUtil.getString(logicalDomain, DefaultIDs.DOMAIN_TARGET_DATABASE);
  if (Const.isEmpty(targetDatabaseName)) {
    throw new KettleException("Please specify a target database!");
  }
  DatabaseMeta targetDatabaseMeta = DatabaseMeta.findDatabase(databases, targetDatabaseName);
  if (targetDatabaseMeta==null) {
    throw new KettleException("Target database with name '"+targetDatabaseName+"' can't be found!");
  }

  // Now start creation of a new domain with physical underpinning.
  //
  Domain domain = new Domain();
  
  // Copy the domain information...
  //
  domain.setId( createId("DOMAIN", null, domain) );
  domain.setName(logicalDomain.getName());
  domain.setDescription(logicalDomain.getDescription());
  
  // Now copy all the models...
  //
  for (LogicalModel logicalModel : logicalDomain.getLogicalModels()) {
    // Copy model information...
    //
    LogicalModel model = new LogicalModel();
    model.setId( createId("MODEL", domain, model));
    model.setName(logicalModel.getName());
    model.setDescription(logicalModel.getDescription());
    
    // Create a physical model...
    //
    SqlPhysicalModel sqlModel = new SqlPhysicalModel();
    sqlModel.setDatasource(createSqlDataSource(targetDatabaseMeta));
    model.setPhysicalModel(sqlModel);
    
    for (LogicalTable logicalTable : logicalModel.getLogicalTables()) {
      LogicalTable table = new LogicalTable();
      table.setId( createId("LOGICAL_TABLE", logicalModel, logicalTable) );
      table.setName(logicalTable.getName());
      table.setDescription(logicalTable.getDescription());
      
      String targetTable = ConceptUtil.getString(logicalTable, DefaultIDs.LOGICAL_TABLE_PHYSICAL_TABLE_NAME);
      
      SqlPhysicalTable sqlTable = new SqlPhysicalTable(sqlModel);
      table.setPhysicalTable(sqlTable);
      
      // Copy name & description from physical level...
      //
      sqlTable.setId( createId("PHYSICAL_TABLE", logicalModel, logicalTable));
      sqlTable.setName(logicalTable.getName());
      sqlTable.setDescription(logicalTable.getDescription());
      sqlTable.setTableType(ConceptUtil.getTableType(logicalTable));
      sqlTable.setTargetSchema(targetDatabaseMeta.getPreferredSchemaName());
      sqlTable.setTargetTable(targetTable);
      
      
    }
  }
  
  return domain;
}
 
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:66,代码来源:MetadataGenerator.java

示例8: generatePhysicalMetadataModel

import org.pentaho.metadata.model.LogicalModel; //导入方法依赖的package包/类
public Domain generatePhysicalMetadataModel() throws KettleException {

    // First do some checking and lookups...
    //
    String targetDatabaseName = ConceptUtil.getString(logicalDomain, DefaultIDs.DOMAIN_TARGET_DATABASE);
    if (Utils.isEmpty(targetDatabaseName)) {
      throw new KettleException("Please specify a target database!");
    }
    DatabaseMeta targetDatabaseMeta = DatabaseMeta.findDatabase(databases, targetDatabaseName);
    if (targetDatabaseMeta==null) {
      throw new KettleException("Target database with name '"+targetDatabaseName+"' can't be found!");
    }

    // Now start creation of a new domain with physical underpinning.
    //
    Domain domain = new Domain();

    // Copy the domain information...
    //
    domain.setId( createId("DOMAIN", null, domain) );
    domain.setName(logicalDomain.getName());
    domain.setDescription(logicalDomain.getDescription());

    // Now copy all the models...
    //
    for (LogicalModel logicalModel : logicalDomain.getLogicalModels()) {
      // Copy model information...
      //
      LogicalModel model = new LogicalModel();
      model.setId( createId("MODEL", domain, model));
      model.setName(logicalModel.getName());
      model.setDescription(logicalModel.getDescription());

      // Create a physical model...
      //
      SqlPhysicalModel sqlModel = new SqlPhysicalModel();
      sqlModel.setDatasource(createSqlDataSource(targetDatabaseMeta));
      model.setPhysicalModel(sqlModel);

      for (LogicalTable logicalTable : logicalModel.getLogicalTables()) {
        LogicalTable table = new LogicalTable();
        table.setId( createId("LOGICAL_TABLE", logicalModel, logicalTable) );
        table.setName(logicalTable.getName());
        table.setDescription(logicalTable.getDescription());

        String targetTable = ConceptUtil.getString(logicalTable, DefaultIDs.LOGICAL_TABLE_PHYSICAL_TABLE_NAME);

        SqlPhysicalTable sqlTable = new SqlPhysicalTable(sqlModel);
        table.setPhysicalTable(sqlTable);

        // Copy name & description from physical level...
        //
        sqlTable.setId( createId("PHYSICAL_TABLE", logicalModel, logicalTable));
        sqlTable.setName(logicalTable.getName());
        sqlTable.setDescription(logicalTable.getDescription());
        sqlTable.setTableType(ConceptUtil.getTableType(logicalTable));
        sqlTable.setTargetSchema(targetDatabaseMeta.getPreferredSchemaName());
        sqlTable.setTargetTable(targetTable);


      }
    }

    return domain;
  }
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:66,代码来源:MetadataGenerator.java


注:本文中的org.pentaho.metadata.model.LogicalModel.getLogicalTables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。