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


Java LogicalModel.setDescription方法代码示例

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


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

示例1: buildLogicalModel

import org.pentaho.metadata.model.LogicalModel; //导入方法依赖的package包/类
/**
 * Inflate a logical model from a metastore element.
 *
 * @param metaStore The metastore to read from
 * @param element The element to read from
 * @return The Logical Model
 * @throws MetaStoreException in case something goes wrong
 */
public static LogicalModel buildLogicalModel(IMetaStore metaStore, IMetaStoreElement element) throws MetaStoreException {
  try {
    LogicalModel model = new LogicalModel();

    model.setName(new LocalizedString(defaultLocale, element.getName()));
    model.setDescription(new LocalizedString(defaultLocale, getChildString(element, Attribute.ID_MODEL_DESCRIPTION.id)));



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

示例2: 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

示例3: getBasicDomain

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

    String locale = LocaleHelper.getLocale().toString();

    SqlPhysicalModel model = new SqlPhysicalModel();
    SqlDataSource dataSource = new SqlDataSource();
    dataSource.setDatabaseName( "SampleData" );
    model.setDatasource( dataSource );
    SqlPhysicalTable table = new SqlPhysicalTable( model );
    table.setId( "PT1" );
    model.getPhysicalTables().add( table );
    table.setTargetTableType( TargetTableType.INLINE_SQL );
    table.setTargetTable( "select * from customers" );

    SqlPhysicalColumn column = new SqlPhysicalColumn( table );
    column.setId( "PC1" );
    column.setTargetColumn( "customername" );
    column.setName( new LocalizedString( locale, "Customer Name" ) );
    column.setDescription( new LocalizedString( locale, "Customer Name Desc" ) );
    column.setDataType( DataType.STRING );
    table.getPhysicalColumns().add( column );

    LogicalModel logicalModel = new LogicalModel();
    logicalModel.setId( "MODEL" );
    logicalModel.setName( new LocalizedString( locale, "My Model" ) );
    logicalModel.setDescription( new LocalizedString( locale, "A Description of the Model" ) );

    LogicalTable logicalTable = new LogicalTable();
    logicalTable.setId( "LT" );
    logicalTable.setPhysicalTable( table );
    logicalTable.setLogicalModel( logicalModel );

    logicalModel.getLogicalTables().add( logicalTable );

    LogicalColumn logicalColumn = new LogicalColumn();
    logicalColumn.setId( "LC_CUSTOMERNAME" );
    logicalColumn.setPhysicalColumn( column );
    logicalColumn.setLogicalTable( logicalTable );
    logicalTable.addLogicalColumn( logicalColumn );

    Category mainCategory = new Category( logicalModel );
    mainCategory.setId( "CATEGORY" );
    mainCategory.setName( new LocalizedString( locale, "Category" ) );
    mainCategory.addLogicalColumn( logicalColumn );

    logicalModel.getCategories().add( mainCategory );

    Domain domain = new Domain();
    domain.setId( "DOMAIN" );
    domain.addPhysicalModel( model );
    domain.addLogicalModel( logicalModel );

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

示例4: 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.setDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。