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


Java Schema.getTableCount方法代码示例

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


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

示例1: getPreviewTable

import org.apache.metamodel.schema.Schema; //导入方法依赖的package包/类
protected Table getPreviewTable(final DataContext dc) {
    final Schema schema = dc.getDefaultSchema();
    if (schema.getTableCount() == 0) {
        return null;
    }
    return schema.getTable(0);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:8,代码来源:AbstractResourceBasedDatastoreDialog.java

示例2: setSchemaTree

import org.apache.metamodel.schema.Schema; //导入方法依赖的package包/类
private void setSchemaTree(final Datastore datastore, final boolean expandTree, final DatastoreConnection con) {
    if (con != null) {
        final Schema defaultSchema = con.getSchemaNavigator().getDefaultSchema();
        final int datastoreSize = defaultSchema.getTableCount();
        if (datastoreSize == 1) {
            _schemaTreePanel.setDatastore(datastore, true);
        } else {
            _schemaTreePanel.setDatastore(datastore, expandTree);
        }
    }
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:12,代码来源:AnalysisJobBuilderWindowImpl.java

示例3: addTableToSource

import org.apache.metamodel.schema.Schema; //导入方法依赖的package包/类
private void addTableToSource(final DatastoreConnection con) {
    if (con != null) {
        final Schema defaultSchema = con.getSchemaNavigator().getDefaultSchema();
        final int datastoreSize = defaultSchema.getTableCount();
        if (datastoreSize == 1) {
            final List<Column> columns = defaultSchema.getTable(0).getColumns();
            _analysisJobBuilder.addSourceColumns(columns);
        }
    }
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:11,代码来源:AnalysisJobBuilderWindowImpl.java

示例4: convertToTable

import org.apache.metamodel.schema.Schema; //导入方法依赖的package包/类
public Table convertToTable(String schemaName, String tableName) {
    final Schema schema;
    if (schemaName == null) {
        schema = getDefaultSchema();
    } else {
        schema = getSchemaByName(schemaName);
    }

    if (schema == null) {
        throw new IllegalArgumentException("Schema " + schemaName + " not found. Available schema names are: "
                + Arrays.toString(dataContext.getSchemaNames()));
    }

    final Table table;
    if (tableName == null) {
        if (schema.getTableCount() == 1) {
            table = schema.getTables()[0];
        } else {
            throw new IllegalArgumentException(
                    "No table name specified, and multiple options exist. Available table names are: "
                            + Arrays.toString(schema.getTableNames()));
        }
    } else {
        table = schema.getTableByName(tableName);
    }

    if (table == null) {
        throw new IllegalArgumentException("Table not found. Available table names are: "
                + Arrays.toString(schema.getTableNames()));
    }

    return table;
}
 
开发者ID:datacleaner,项目名称:AnalyzerBeans,代码行数:34,代码来源:SchemaNavigator.java

示例5: getColumnPathQualification

import org.apache.metamodel.schema.Schema; //导入方法依赖的package包/类
private String getColumnPathQualification(Datastore datastore, Collection<InputColumn<?>> sourceColumns) {
    if (datastore == null || sourceColumns == null || sourceColumns.isEmpty()) {
        return COLUMN_PATH_QUALIFICATION_FULL;
    }

    try (DatastoreConnection connection = datastore.openConnection()) {
        SchemaNavigator schemaNavigator = connection.getSchemaNavigator();
        Schema[] schemas = schemaNavigator.getSchemas();
        Schema singleSchema = null;
        int realSchemas = 0;
        for (Schema schema : schemas) {
            if (!MetaModelHelper.isInformationSchema(schema)) {
                realSchemas++;
                singleSchema = schema;
            }
        }

        if (realSchemas == 1) {
            if (singleSchema.getTableCount() == 1) {
                return COLUMN_PATH_QUALIFICATION_COLUMN;
            }
            return COLUMN_PATH_QUALIFICATION_TABLE;
        }

        return COLUMN_PATH_QUALIFICATION_FULL;
    }
}
 
开发者ID:datacleaner,项目名称:AnalyzerBeans,代码行数:28,代码来源:JaxbJobWriter.java

示例6: getDefaultSchema

import org.apache.metamodel.schema.Schema; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public final Schema getDefaultSchema() throws MetaModelException {
    Schema result = null;
    final String defaultSchemaName = getDefaultSchemaName();
    if (defaultSchemaName != null) {
        result = getSchemaByName(defaultSchemaName);
    }
    if (result == null) {
        final List<Schema> schemas = getSchemas();
        if (schemas.size() == 1) {
            result = schemas.get(0);
        } else {
            int highestTableCount = -1;
            for (Schema schema : schemas) {
                String name = schema.getName();
                if (schema != null) {
                    name = name.toLowerCase();
                    final boolean isInformationSchema = name.startsWith("information") && name.endsWith("schema");
                    if (!isInformationSchema && schema.getTableCount() > highestTableCount) {
                        highestTableCount = schema.getTableCount();
                        result = schema;
                    }
                }
            }
        }
    }
    return result;
}
 
开发者ID:apache,项目名称:metamodel,代码行数:32,代码来源:AbstractDataContext.java


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