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


Java Column.getName方法代码示例

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


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

示例1: addColumn

import org.apache.metamodel.schema.Column; //导入方法依赖的package包/类
private void addColumn(Column rawColumn, MTable mTable) {
    String columnName = rawColumn.getName();
    ColumnType columnType = rawColumn.getType();
    if (ColumnType.STRING.getName().equalsIgnoreCase(columnType.getName())) {
        columnType = ColumnTypeImpl.convertColumnType(Types.VARCHAR);
    }
    int jdbcType = columnType.getJdbcType();
    int typeInfo = -1;
    if (jdbcType == Types.VARCHAR) {
        Integer columnSize = rawColumn.getColumnSize();
        if (columnSize == null) {
            // FIXME: what is the proper length value?
            typeInfo = 128;
        } else {
            typeInfo = columnSize;
        }
    }

    LOG.debug("add column. columnName=" + columnName + ", jdbcType=" + jdbcType + ", typeInfo=" + typeInfo);
    MColumn mColumn = new MColumn(columnName, jdbcType, typeInfo, mTable);
    pm.makePersistent(mColumn);
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:23,代码来源:JDOMetaContext.java

示例2: updateColumnsOfTable

import org.apache.metamodel.schema.Column; //导入方法依赖的package包/类
private void updateColumnsOfTable(Table rawTable, MTable mTable) throws MetaException {
    Map<String, MColumn> oldColumns = new HashMap<>();

    for (MetaColumn col : mTable.getColumns())
        oldColumns.put(col.getName(), (MColumn) col);

    Set<String> oldColumnNames = new TreeSet<>(oldColumns.keySet());
    Set<String> newColumnNames = new TreeSet<>();

    for (Column rawColumn : getRawTableColumns(rawTable)) {
        String colName = rawColumn.getName();

        newColumnNames.add(colName);

        /* NOTE: column order could be wrong! */
        if (!oldColumns.containsKey(colName))
            addColumn(rawColumn, mTable);
    }

    // remove old columns
    oldColumnNames.removeAll(newColumnNames);
    for (String name : oldColumnNames)
        pm.deletePersistent(oldColumns.get(name));
}
 
开发者ID:bitnine-oss,项目名称:octopus,代码行数:25,代码来源:JDOMetaContext.java

示例3: getColumnPath

import org.apache.metamodel.schema.Column; //导入方法依赖的package包/类
private String getColumnPath(final Column column, final String columnPathQualification) {
    switch (columnPathQualification) {
    case COLUMN_PATH_QUALIFICATION_COLUMN:
        final String columnName = column.getName();
        if (Strings.isNullOrEmpty(columnName)) {
            return column.getTable().getName() + '.' + column.getName();
        }
        return column.getName();
    case COLUMN_PATH_QUALIFICATION_TABLE:
        return column.getTable().getName() + '.' + column.getName();
    case COLUMN_PATH_QUALIFICATION_FULL:
    default:
        return column.getQualifiedLabel();
    }
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:16,代码来源:JaxbJobWriter.java

示例4: getColumnMetadata

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

示例5: getOutputColumns

import org.apache.metamodel.schema.Column; //导入方法依赖的package包/类
@Override
public OutputColumns getOutputColumns() {
    final Column[] queryOutputColumns = getQueryOutputColumns(true);
    final String[] names = new String[queryOutputColumns.length];
    final Class<?>[] types = new Class[queryOutputColumns.length];
    for (int i = 0; i < queryOutputColumns.length; i++) {
        final Column column = queryOutputColumns[i];
        if (column == null) {
            throw new IllegalArgumentException("Could not find column: " + outputColumns[i]);
        }
        names[i] = column.getName() + " (lookup)";
        types[i] = column.getType().getJavaEquivalentClass();
    }
    return new OutputColumns(names, types);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:16,代码来源:TableLookupTransformer.java

示例6: doInBackground

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

示例7: getValue

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

示例8: setModel

import org.apache.metamodel.schema.Column; //导入方法依赖的package包/类
public void setModel(final Datastore datastore, final Table table) {
    final String previousColumnName;
    final Column previousItem = getSelectedItem();
    if (previousItem == null) {
        previousColumnName = null;
    } else {
        previousColumnName = previousItem.getName();
    }

    if (getTable() == table) {
        return;
    }
    setTable(table);

    if (datastore == null) {
        setDatastoreConnection(null);
    } else {
        setDatastoreConnection(datastore.openConnection());
    }
    if (table == null) {
        setModel(new DefaultComboBoxModel<>(new String[1]));
    } else {
        int selectedIndex = 0;

        final List<Column> comboBoxList = new ArrayList<>();
        comboBoxList.add(null);

        final List<Column> columns = table.getColumns();
        for (final Column column : columns) {
            comboBoxList.add(column);
            if (column.getName().equals(previousColumnName)) {
                selectedIndex = comboBoxList.size() - 1;
            }
        }
        final ComboBoxModel<Object> model = new DefaultComboBoxModel<>(comboBoxList.toArray());
        setModel(model);
        setSelectedIndex(selectedIndex);
    }
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:40,代码来源:SourceColumnComboBox.java

示例9: getColumnPath

import org.apache.metamodel.schema.Column; //导入方法依赖的package包/类
private String getColumnPath(Column column, String columnPathQualification) {
    switch (columnPathQualification) {
    case COLUMN_PATH_QUALIFICATION_COLUMN:
        final String columnName = column.getName();
        if (Strings.isNullOrEmpty(columnName)) {
            return column.getTable().getName() + '.' + column.getName();
        }
        return column.getName();
    case COLUMN_PATH_QUALIFICATION_TABLE:
        return column.getTable().getName() + '.' + column.getName();
    case COLUMN_PATH_QUALIFICATION_FULL:
    default:
        return column.getQualifiedLabel();
    }
}
 
开发者ID:datacleaner,项目名称:AnalyzerBeans,代码行数:16,代码来源:JaxbJobWriter.java

示例10: getOutputColumns

import org.apache.metamodel.schema.Column; //导入方法依赖的package包/类
@Override
public OutputColumns getOutputColumns() {
    Column[] queryOutputColumns = getQueryOutputColumns(true);
    String[] names = new String[queryOutputColumns.length];
    Class<?>[] types = new Class[queryOutputColumns.length];
    for (int i = 0; i < queryOutputColumns.length; i++) {
        Column column = queryOutputColumns[i];
        if (column == null) {
            throw new IllegalArgumentException("Could not find column: " + outputColumns[i]);
        }
        names[i] = column.getName() + " (lookup)";
        types[i] = column.getType().getJavaEquivalentClass();
    }
    return new OutputColumns(names, types);
}
 
开发者ID:datacleaner,项目名称:AnalyzerBeans,代码行数:16,代码来源:TableLookupTransformer.java

示例11: getColumnMetadata

import org.apache.metamodel.schema.Column; //导入方法依赖的package包/类
@Override
public ColumnMetadata getColumnMetadata(Column column) {
    if (column == null) {
        return null;
    }
    final String columnName = column.getName();
    return getColumnMetadataByName(columnName);
}
 
开发者ID:datacleaner,项目名称:AnalyzerBeans,代码行数:9,代码来源:ColumnGroupMetadataImpl.java

示例12: testSerializeDeserializeDatastores

import org.apache.metamodel.schema.Column; //导入方法依赖的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

示例13: MockInputColumn

import org.apache.metamodel.schema.Column; //导入方法依赖的package包/类
public MockInputColumn(final Column physicalColumn, final Class<? extends E> clazz) {
    this(physicalColumn.getName(), clazz, physicalColumn);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:4,代码来源:MockInputColumn.java


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