本文整理汇总了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);
}
示例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));
}
示例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();
}
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}
}
}
}
}
示例13: MockInputColumn
import org.apache.metamodel.schema.Column; //导入方法依赖的package包/类
public MockInputColumn(final Column physicalColumn, final Class<? extends E> clazz) {
this(physicalColumn.getName(), clazz, physicalColumn);
}