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


Java Table.getName方法代码示例

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


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

示例1: executeBlockingly

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
public void executeBlockingly() {
    if (!isNeeded()) {
        return;
    }
    final Schema schema = (Schema) _schemaNode.getUserObject();
    final List<Table> tables = schema.getTables();
    for (final Table table : tables) {
        final String name = table.getName();
        logger.debug("Building table node: {}", name);
        final DefaultMutableTreeNode tableNode = new DefaultMutableTreeNode(table);
        final DefaultMutableTreeNode loadingColumnsNode = new DefaultMutableTreeNode(LOADING_COLUMNS_STRING);
        tableNode.add(loadingColumnsNode);
        _schemaNode.add(tableNode);
    }
    _schemaNode.remove(0);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:17,代码来源:SchemaTree.java

示例2: get

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public GetTableResponse get(@PathVariable("tenant") String tenantId,
        @PathVariable("dataContext") String dataSourceName, @PathVariable("schema") String schemaId,
        @PathVariable("table") String tableId) {
    final TenantContext tenantContext = tenantRegistry.getTenantContext(tenantId);
    final DataContext dataContext = tenantContext.getDataSourceRegistry().openDataContext(dataSourceName);

    final DataContextTraverser traverser = new DataContextTraverser(dataContext);

    final Table table = traverser.getTable(schemaId, tableId);

    final String tenantName = tenantContext.getTenantName();
    final UriBuilder uriBuilder = UriBuilder.fromPath("/{tenant}/{dataContext}/s/{schema}/t/{table}/c/{column}");

    final String tableName = table.getName();
    final String schemaName = table.getSchema().getName();
    final List<GetTableResponseColumns> columnsLinks = table.getColumnNames().stream().map(c -> {
        final String uri = uriBuilder.build(tenantName, dataSourceName, schemaName, tableName, c).toString();
        return new GetTableResponseColumns().name(c).uri(uri);
    }).collect(Collectors.toList());

    final GetTableResponse resp = new GetTableResponse();
    resp.type("table");
    resp.name(tableName);
    resp.schema(schemaName);
    resp.datasource(dataSourceName);
    resp.tenant(tenantName);
    resp.columns(columnsLinks);
    return resp;
}
 
开发者ID:apache,项目名称:metamodel-membrane,代码行数:32,代码来源:TableController.java

示例3: getRawTableColumns

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
private Column[] getRawTableColumns(Table rawTable) throws MetaException {
    Column[] rawColumns = rawTable.getColumns();
    if (rawColumns == null || rawColumns.length < 1)
        throw new MetaException("table '" + rawTable.getName() + "' has no column");

    return rawColumns;
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:8,代码来源:JDOMetaContext.java

示例4: addTablesOfSchema

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
private void addTablesOfSchema(Schema rawSchema, MSchema mSchema, UpdateLogger upLog) throws MetaException {
    for (Table rawTable : rawSchema.getTables()) {
        String tableName = rawTable.getName();
        TableType tableType = rawTable.getType();

        LOG.debug("add table. tableName=" + tableName);
        // TODO: handle table type (SYSTEM_TABLE, ALIAS, SYNONYM etc...)
        MTable mTable = new MTable(tableName, tableType.name(), mSchema);
        pm.makePersistent(mTable);
        if (upLog != null)
            upLog.create(null, tableName);

        addColumnsOfTable(rawTable, mTable);
    }
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:16,代码来源:JDOMetaContext.java

示例5: getTableMetadata

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
@Override
public TableMetadata getTableMetadata(final Table table) {
    if (table == null) {
        return null;
    }
    final String tableName = table.getName();
    return getTableMetadataByName(tableName);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:9,代码来源:SchemaMetadataImpl.java

示例6: getTablePostFix

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
private static String getTablePostFix(final Table table) {
    final String postFix;
    final Schema schema = table.getSchema();
    if (schema == null) {
        postFix = "." + table.getName();
    } else {
        postFix = "." + schema.getName() + "." + table.getName();
    }
    return postFix;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:11,代码来源:JobGraphMetadata.java

示例7: createTableDef

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
private SimpleTableDef createTableDef(final Table table) {
    final int columnCount = table.getColumnCount();
    final String[] names = new String[columnCount];
    final ColumnType[] types = new ColumnType[columnCount];
    for (int i = 0; i < columnCount; i++) {
        names[i] = table.getColumn(i).getName();
        types[i] = table.getColumn(i).getType();
    }
    return new SimpleTableDef(table.getName(), names, types);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:11,代码来源:SimpleTableDefsPanel.java

示例8: doInBackground

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
@Override
protected Void doInBackground() throws Exception {
    final Schema schema = (Schema) _schemaNode.getUserObject();
    final List<Table> tables = schema.getTables();
    for (final Table table : tables) {
        final String name = table.getName();
        logger.debug("Publishing table name: {}", name);
        publish(table);
    }
    return null;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:12,代码来源:SchemaTree.java

示例9: getValue

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
@Override
public String getValue() {
    final Table table = getTable();
    if (table == null) {
        return null;
    }
    return table.getName();
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:9,代码来源:SingleTableNamePropertyWidget.java

示例10: getPropertyKey

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
/**
 * Gets the key to use in the capture state file. If there is not a
 * captureStateIdentifier available, we want to avoid using a hardcoded key,
 * since the same file may be used for multiple purposes, even multiple
 * filters of the same type. Of course this is not desired configuration,
 * but may be more convenient for lazy users!
 *
 * @return
 */
private String getPropertyKey() {
    if (StringUtils.isNullOrEmpty(captureStateIdentifier)) {
        if (lastModifiedColumn.isPhysicalColumn()) {
            final Table table = lastModifiedColumn.getPhysicalColumn().getTable();
            if (table != null && !StringUtils.isNullOrEmpty(table.getName())) {
                return table.getName() + "." + lastModifiedColumn.getName() + ".GreatestLastModifiedValue";
            }
        }
        return lastModifiedColumn.getName() + ".GreatestLastModifiedValue";
    }
    return captureStateIdentifier.trim() + ".GreatestLastModifiedValue";
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:22,代码来源:CaptureChangedRecordsFilter.java

示例11: getTableMetadata

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
@Override
public TableMetadata getTableMetadata(Table table) {
    if (table == null) {
        return null;
    }
    final String tableName = table.getName();
    return getTableMetadataByName(tableName);
}
 
开发者ID:datacleaner,项目名称:AnalyzerBeans,代码行数:9,代码来源:SchemaMetadataImpl.java

示例12: getPropertyKey

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
/**
 * Gets the key to use in the capture state file. If there is not a
 * captureStateIdentifier available, we want to avoid using a hardcoded key,
 * since the same file may be used for multiple purposes, even multiple
 * filters of the same type. Of course this is not desired configuration,
 * but may be more convenient for lazy users!
 * 
 * @return
 */
private String getPropertyKey() {
    if (StringUtils.isNullOrEmpty(captureStateIdentifier)) {
        if (lastModifiedColumn.isPhysicalColumn()) {
            Table table = lastModifiedColumn.getPhysicalColumn().getTable();
            if (table != null && !StringUtils.isNullOrEmpty(table.getName())) {
                return table.getName() + "." + lastModifiedColumn.getName() + ".GreatestLastModifiedTimestamp";
            }
        }
        return lastModifiedColumn.getName() + ".GreatestLastModifiedTimestamp";
    }
    return captureStateIdentifier.trim() + ".GreatestLastModifiedTimestamp";
}
 
开发者ID:datacleaner,项目名称:AnalyzerBeans,代码行数:22,代码来源:CaptureChangedRecordsFilter.java

示例13: testSerializeDeserializeDatastores

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
@Test
public void testSerializeDeserializeDatastores() {
    String csv = ConfigurationSerializer.serializeAnalyzerBeansConfigurationDataStores(analyzerBeansConfiguration);
    logger.info("Csv: " + csv);
    AnalyzerBeansConfiguration deserialized = ConfigurationSerializer.deserializeAnalyzerBeansDatastores(csv);
    for (String datastoreName : analyzerBeansConfiguration.getDatastoreCatalog().getDatastoreNames()) {
        logger.info("Datastore: " + datastoreName);
        Datastore datastore = analyzerBeansConfiguration.getDatastoreCatalog().getDatastore(datastoreName);
        Datastore deserializedDatastore = deserialized.getDatastoreCatalog().getDatastore(datastoreName);
        Assert.assertNotNull(deserializedDatastore);

        SchemaNavigator schemaNavigator = datastore.openConnection().getSchemaNavigator();
        SchemaNavigator deserializedSchemaNavigator = deserializedDatastore.openConnection().getSchemaNavigator();
        for (Schema schema : schemaNavigator.getSchemas()) {
            String schemaName = schema.getName();
            logger.info("\tSchema: " + schemaName);
            Schema deserializedSchema = deserializedSchemaNavigator.getSchemaByName(schemaName);
            Assert.assertNotNull(deserializedSchema);

            for (Table table : schema.getTables()) {
                String tableName = table.getName();
                logger.info("\t\tTable: " + tableName);
                Table deserializedTable = deserializedSchema.getTableByName(tableName);
                Assert.assertNotNull(deserializedTable);

                for (Column column : table.getColumns()) {
                    String columnName = column.getName();
                    logger.info("\t\t\tColumn: " + columnName);
                    Column deserializedColumn = deserializedTable.getColumnByName(columnName);
                    Assert.assertNotNull(deserializedColumn);
                }
            }
        }
    }
}
 
开发者ID:tomaszguzialek,项目名称:hadoop-datacleaner,代码行数:36,代码来源:ConfigurationSerializerTest.java

示例14: getTableName

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
private String getTableName(){
	Schema schema = creator.getDataContext().getDefaultSchema();
	Table table = schema.getTableByName("TESTTABLE");
	return table.getName();
}
 
开发者ID:Iranox,项目名称:mapbench-datadistributor,代码行数:6,代码来源:TableCreatorTest.java

示例15: limitJobRows

import org.apache.metamodel.schema.Table; //导入方法依赖的package包/类
public static void limitJobRows(final AnalysisJobBuilder jobBuilder,
        final Collection<? extends ComponentBuilder> componentBuilders, final int previewRows) {
    {
        final SourceColumnFinder sourceColumnFinder = new SourceColumnFinder();
        sourceColumnFinder.addSources(jobBuilder);
        final List<Table> sourceTables = jobBuilder.getSourceTables();
        final int maxRows = Double.valueOf(Math.ceil(((double) previewRows) / sourceTables.size())).intValue();
        for (final Table table : sourceTables) {
            final String filterName = PreviewUtils.class.getName() + "-" + table.getName() + "-MaxRows";

            final FilterComponentBuilder<?, ?> maxRowFilter =
                    jobBuilder.getFilterComponentBuilderByName(filterName).orElseGet(() -> {
                        final FilterComponentBuilder<MaxRowsFilter, MaxRowsFilter.Category> filter =
                                jobBuilder.addFilter(MaxRowsFilter.class);
                        filter.setName(filterName);
                        filter.getComponentInstance().setMaxRows(maxRows);
                        filter.getComponentInstance().setApplyOrdering(false);
                        filter.getComponentInstance()
                                .setOrderColumn(jobBuilder.getSourceColumnsOfTable(table).get(0));
                        return filter;
                    });

            componentBuilders.stream().filter(cb -> cb != maxRowFilter).forEach(componentBuilder -> {
                final InputColumn<?>[] input = componentBuilder.getInput();
                if (input.length > 0) {
                    if (componentBuilder.getDescriptor().isMultiStreamComponent()
                            || sourceColumnFinder.findOriginatingTable(input[0]) == table) {
                        final ComponentRequirement existingRequirement = componentBuilder.getComponentRequirement();
                        if (existingRequirement != null) {
                            if (componentBuilder.getDescriptor().isMultiStreamComponent()) {
                                componentBuilder.setComponentRequirement(
                                        new CompoundComponentRequirement(existingRequirement,
                                                maxRowFilter.getFilterOutcome(MaxRowsFilter.Category.VALID)));
                            }
                        } else {
                            componentBuilder.setComponentRequirement(new SimpleComponentRequirement(
                                    maxRowFilter.getFilterOutcome(MaxRowsFilter.Category.VALID)));
                        }
                    }
                }
            });
        }
    }
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:45,代码来源:PreviewUtils.java


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