本文整理汇总了Java中org.apache.metamodel.schema.Table类的典型用法代码示例。如果您正苦于以下问题:Java Table类的具体用法?Java Table怎么用?Java Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Table类属于org.apache.metamodel.schema包,在下文中一共展示了Table类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: get
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public QueryResponse get(@PathVariable("tenant") String tenantId,
@PathVariable("dataContext") String dataSourceName, @PathVariable("schema") String schemaId,
@PathVariable("table") String tableId, @RequestParam(value = "offset", required = false) Integer offset,
@RequestParam(value = "limit", required = false) Integer limit) {
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 Query query = dataContext.query().from(table).selectAll().toQuery();
return QueryController.executeQuery(tenantContext, dataSourceName, dataContext, query, offset, limit);
}
开发者ID:apache,项目名称:metamodel-membrane,代码行数:18,代码来源:TableDataController.java
示例2: createWriter
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
public static Writer createWriter(Project project, List<Table> tables){
Writer writer = null;
String framework = project.getFramework();
switch(framework){
case "spark":
writer = new SparkWriter(project, tables);
break;
case "nethttp":
writer = new NetHttpWriter(project, tables);
break;
case "express":
writer = new ExpressWriter(project, tables);
default:
throw new FrameworkNotSupportedExecption("Writer Factory Error: Code writer for "+ framework+" is not supported yet.");
}
return writer;
}
开发者ID:azzuwan,项目名称:Novogen,代码行数:24,代码来源:WriterFactory.java
示例3: updateColumnsOfTable
import org.apache.metamodel.schema.Table; //导入依赖的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
示例4: configureForTransformedData
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
@Override
public void configureForTransformedData(final AnalysisJobBuilder analysisJobBuilder,
final TransformerDescriptor<?> descriptor) {
final List<Table> tables = analysisJobBuilder.getSourceTables();
if (tables.size() == 1) {
final List<MetaModelInputColumn> sourceColumns = analysisJobBuilder.getSourceColumnsOfTable(tables.get(0));
final List<InputColumn<?>> primaryKeys = new ArrayList<>();
for (final MetaModelInputColumn inputColumn : sourceColumns) {
if (inputColumn.getPhysicalColumn().isPrimaryKey()) {
primaryKeys.add(inputColumn);
}
}
if (!primaryKeys.isEmpty()) {
conditionValues = primaryKeys.toArray(new InputColumn[primaryKeys.size()]);
}
}
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:19,代码来源:DeleteFromTableAnalyzer.java
示例5: createComboBox
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
private SourceColumnComboBox createComboBox(final InputColumn<?> inputColumn, Column mappedColumn) {
final SourceColumnComboBox sourceColumnComboBox = new SourceColumnComboBox();
_mappedColumnComboBoxes.put(inputColumn, sourceColumnComboBox);
final Table table = _tableRef.get();
if (mappedColumn == null && table != null) {
mappedColumn = getDefaultMappedColumn(inputColumn, table);
}
if (mappedColumn == null) {
logger.info("No default mapping found for column: {}", inputColumn);
} else {
sourceColumnComboBox.setEditable(true);
sourceColumnComboBox.setSelectedItem(mappedColumn);
sourceColumnComboBox.setEditable(false);
}
sourceColumnComboBox.addColumnSelectedListener(item -> {
if (isBatchUpdating()) {
return;
}
_mappedColumnNamesPropertyWidget.fireValueChanged();
fireValueChanged();
});
return sourceColumnComboBox;
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:26,代码来源:MultipleMappedColumnsPropertyWidget.java
示例6: showTableConfigurationDialog
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
public void showTableConfigurationDialog(final Table table) {
final SourceTableConfigurationDialog existingDialog = _tableConfigurationDialogs.get(table);
if (existingDialog != null) {
existingDialog.toFront();
return;
}
final AnalysisJobBuilder analysisJobBuilder = _graphContext.getAnalysisJobBuilder(table);
final SourceTableConfigurationDialog dialog =
new SourceTableConfigurationDialog(_windowContext, analysisJobBuilder, table);
dialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(final WindowEvent e) {
_tableConfigurationDialogs.remove(table);
}
});
_tableConfigurationDialogs.put(table, dialog);
dialog.open();
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:22,代码来源:JobGraphActions.java
示例7: getLocalInputColumns
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
private InputColumn<?>[] getLocalInputColumns(final SourceColumnFinder sourceColumnFinder, final Table table,
final InputColumn<?>[] inputColumns) {
if (table == null || inputColumns == null || inputColumns.length == 0) {
return new InputColumn<?>[0];
}
final List<InputColumn<?>> result = new ArrayList<>();
for (final InputColumn<?> inputColumn : inputColumns) {
final Set<Column> sourcePhysicalColumns = sourceColumnFinder.findOriginatingColumns(inputColumn);
for (final Column physicalColumn : sourcePhysicalColumns) {
if (table.equals(physicalColumn.getTable())) {
result.add(inputColumn);
break;
}
}
}
return result.toArray(new InputColumn<?>[result.size()]);
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:18,代码来源:RowProcessingPublishers.java
示例8: findOriginatingTable
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
private Table findOriginatingTable(InputColumn<?> inputColumn, Set<Object> resolvedSet) {
if (!resolvedSet.add(inputColumn)) {
logger.debug(LOG_MESSAGE_RECURSIVE_TRAVERSAL);
return null;
}
if (inputColumn == null) {
logger.warn("InputColumn was null, no originating table found");
return null;
}
if (inputColumn.isPhysicalColumn()) {
return inputColumn.getPhysicalColumn().getTable();
}
final InputColumnSourceJob inputColumnSource = findInputColumnSource(inputColumn);
if (!resolvedSet.add(inputColumnSource)) {
logger.debug(LOG_MESSAGE_RECURSIVE_TRAVERSAL);
return null;
}
return findOriginatingTableOfSource(inputColumnSource, resolvedSet);
}
开发者ID:datacleaner,项目名称:AnalyzerBeans,代码行数:23,代码来源:SourceColumnFinder.java
示例9: registerEnterConfigurationAction
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
private void registerEnterConfigurationAction() {
registerAction(KEY_ENTER, KeyStroke.getKeyStroke(KEY_ENTER), new JobGraphBindingAction() {
@Override
public void actionPerformed(final ActionEvent e) {
final Set<Object> vertices = _graphContext.getSelectedVertices();
if (vertices.size() != 1) {
return;
}
final Object vertex = vertices.iterator().next();
if (vertex instanceof ComponentBuilder) {
final ComponentBuilder componentBuilder = (ComponentBuilder) vertex;
_actions.showConfigurationDialog(componentBuilder);
} else if (vertex instanceof Table) {
final Table table = (Table) vertex;
_actions.showTableConfigurationDialog(table);
}
}
});
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:23,代码来源:JobGraphBindingsManager.java
示例10: getMainSchema
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
@Override
protected Schema getMainSchema() throws MetaModelException {
return new AbstractSchema() {
private static final long serialVersionUID = 1L;
@Override
public String getQuote() {
return null;
}
@Override
public List<Table> getTables() {
return Collections.singletonList(_outputDataStream.getTable());
}
@Override
public String getName() {
return null;
}
};
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:22,代码来源:OutputDataStreamDataContext.java
示例11: findOriginatingTable
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
private Table findOriginatingTable(final InputColumn<?> inputColumn, final Set<Object> resolvedSet) {
if (!resolvedSet.add(inputColumn)) {
logger.debug(LOG_MESSAGE_RECURSIVE_TRAVERSAL);
return null;
}
if (inputColumn == null) {
logger.warn("InputColumn was null, no originating table found");
return null;
}
if (inputColumn.isPhysicalColumn()) {
return inputColumn.getPhysicalColumn().getTable();
}
final InputColumnSourceJob inputColumnSource = findInputColumnSource(inputColumn);
if (!resolvedSet.add(inputColumnSource)) {
logger.debug(LOG_MESSAGE_RECURSIVE_TRAVERSAL);
return null;
}
return findOriginatingTableOfSource(inputColumnSource, resolvedSet);
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:23,代码来源:SourceColumnFinder.java
示例12: toString
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
@Override
public String toString(final Object o) {
final String result;
if (o instanceof Schema) {
result = ((Schema) o).getName();
} else if (o instanceof Table) {
result = ((Table) o).getQualifiedLabel();
} else if (o instanceof Column) {
result = ((Column) o).getQualifiedLabel();
} else if (o instanceof Dictionary) {
result = ((Dictionary) o).getName();
} else if (o instanceof SynonymCatalog) {
result = ((SynonymCatalog) o).getName();
} else if (o instanceof StringPattern) {
result = ((StringPattern) o).getName();
} else if (o instanceof Datastore) {
result = ((Datastore) o).getName();
} else {
logger.warn("Could not convert type: {}", o.getClass().getName());
result = o.toString();
}
return result;
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:24,代码来源:ConfigurationItemConverter.java
示例13: compileLookupQuery
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
private void compileLookupQuery() {
try {
final Column[] queryOutputColumns = getQueryOutputColumns(false);
final Column queryOutputColumn = queryOutputColumns[0];
final Table table = queryOutputColumn.getTable();
Query query = new Query().from(table).select(queryOutputColumns);
if (!isCarthesianProductMode()) {
final Column[] queryConditionColumns = getQueryConditionColumns();
for (int i = 0; i < queryConditionColumns.length; i++) {
query = query.where(queryConditionColumns[i], OperatorType.EQUALS_TO, new QueryParameter());
}
}
if (joinSemantic == JoinSemantic.LEFT_JOIN_MAX_ONE) {
query = query.setMaxRows(1);
}
lookupQuery = datastoreConnection.getDataContext().compileQuery(query);
} catch (final RuntimeException e) {
logger.error("Error occurred while compiling lookup query", e);
throw e;
}
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:27,代码来源:TableLookupTransformer.java
示例14: 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
示例15: truncateIfNecesary
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
/**
* Truncates the database table if necesary. This is NOT a distributable
* initializer, since it can only happen once.
*/
@Initialize(distributed = false)
public void truncateIfNecesary() {
if (truncateTable) {
try (UpdateableDatastoreConnection con = datastore.openConnection()) {
final SchemaNavigator schemaNavigator = con.getSchemaNavigator();
final Table table = schemaNavigator.convertToTable(schemaName, tableName);
final UpdateableDataContext dc = con.getUpdateableDataContext();
dc.executeUpdate(callback -> {
final RowDeletionBuilder delete = callback.deleteFrom(table);
if (logger.isInfoEnabled()) {
logger.info("Executing truncating DELETE operation: {}", delete.toSql());
}
delete.execute();
});
}
}
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:24,代码来源:InsertIntoTableAnalyzer.java
示例16: TableProgressInformationPanel
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
public TableProgressInformationPanel(final Table table, final int expectedRows) {
_table = table;
_progressBar = new DCProgressBar(0, expectedRows);
_progressStatusLabel = DCLabel.bright("");
_progressCountLabel = DCLabel.bright("0");
_progressExpectationLabel = DCLabel.bright("");
_progressStatusLabel.setFont(FONT);
_progressCountLabel.setFont(FONT);
_progressExpectationLabel.setFont(FONT);
final GridBagLayout layout = new GridBagLayout();
layout.columnWidths = new int[] { 150 };
setLayout(layout);
setBorder(new EmptyBorder(4, 4, 4, 4));
final DCPanel rightSidePanel = new DCPanel();
rightSidePanel.setLayout(new BorderLayout());
rightSidePanel.add(Box.createVerticalStrut(8), BorderLayout.NORTH);
rightSidePanel.add(_progressBar, BorderLayout.CENTER);
rightSidePanel.add(createRecordCountPanel(), BorderLayout.SOUTH);
WidgetUtils.addToGridBag(createTableLabel(), this, 0, 0);
WidgetUtils.addToGridBag(rightSidePanel, this, 1, 0, 1.0, 0.0);
}
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:27,代码来源:TableProgressInformationPanel.java
示例17: getTable
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
public Table getTable(String schemaName, String tableName) {
final Table table = getSchema(schemaName).getTableByName(tableName);
if (table == null) {
throw new NoSuchTableException(tableName);
}
return table;
}
开发者ID:apache,项目名称:metamodel-membrane,代码行数:8,代码来源:DataContextTraverser.java
示例18: 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
示例19: setWhere
import org.apache.metamodel.schema.Table; //导入依赖的package包/类
private void setWhere(WhereClauseBuilder<?> whereBuilder, Table table, List<WhereCondition> conditions) {
for (WhereCondition condition : conditions) {
final Column column = table.getColumnByName(condition.getColumn());
if (column == null) {
throw new IllegalArgumentException("No such column: " + condition.getColumn());
}
final OperatorType operator = toOperator(condition.getOperator());
final FilterItem filterItem = new FilterItem(new SelectItem(column), operator, condition.getOperand());
whereBuilder.where(filterItem);
}
}
开发者ID:apache,项目名称:metamodel-membrane,代码行数:12,代码来源:TableDataController.java
示例20: 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
注:本文中的org.apache.metamodel.schema.Table类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论