org.teiid.language.Update.getTable()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(228)

本文整理了Java中org.teiid.language.Update.getTable()方法的一些代码示例,展示了Update.getTable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Update.getTable()方法的具体详情如下:
包路径:org.teiid.language.Update
类名称:Update
方法名:getTable

Update.getTable介绍

暂无

代码示例

代码示例来源:origin: org.teiid.connectors/translator-salesforce

@Override
public void visit(Update update) {
  // don't visit the changes or they will be in the query.
  visitNode(update.getTable());
  visitNode(update.getWhere());
  try {
    loadColumnMetadata(update.getTable());
  } catch (TranslatorException ce) {
    exceptions.add(ce);
  }
}

代码示例来源:origin: teiid/teiid

public void visit(Update obj) {
  buffer.append(UPDATE)
     .append(Tokens.SPACE);
  appendSourceComment(obj);
  append(obj.getTable());
  buffer.append(Tokens.SPACE)
     .append(SET)
     .append(Tokens.SPACE);
  append(obj.getChanges()); 
  if (obj.getWhere() != null) {
    buffer.append(Tokens.SPACE)
       .append(WHERE)
       .append(Tokens.SPACE);
    append(obj.getWhere());
  }
}

代码示例来源:origin: org.teiid.connectors/translator-odata

@Override
public void visit(Update obj) {
  this.method = "PUT"; //$NON-NLS-1$
  this.entity = obj.getTable().getMetadataObject();
  visitNode(obj.getTable());
  
  // only pk are allowed, no other criteria not allowed
  obj.setWhere(buildEntityKey(obj.getWhere()));
  
  // this will build with entity keys
  this.uri = getEnitityURL();
  
  if (this.uri.indexOf('(') == -1) {
    this.exceptions.add(new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17011, this.filter.toString())));
  }
  
  if (this.filter.length() > 0) {
    this.exceptions.add(new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17009, this.filter.toString())));
  }
  
  final List<OProperty<?>> props = new ArrayList<OProperty<?>>();
  int elementCount = obj.getChanges().size();
  for (int i = 0; i < elementCount; i++) {
    Column column = obj.getChanges().get(i).getSymbol().getMetadataObject();
    OProperty<?> property = readProperty(column, obj.getChanges().get(i).getValue());
    props.add(property);
  }
  this.payload = props;
}

代码示例来源:origin: org.teiid.connectors/translator-phoenix

insert = new Insert(update.getTable(), cols, new ExpressionValueSource(vals));
} else {
  List<DerivedColumn> select = new ArrayList<DerivedColumn>();
  KeyRecord pk = update.getTable().getMetadataObject().getPrimaryKey();
  if(pk != null) {
    for (Column c : pk.getColumns()) {
      if (!columns.contains(c)) {
        ColumnReference cr = new ColumnReference(update.getTable(), c.getName(), c, c.getJavaType());
        select.add(new DerivedColumn(null, cr));
        cols.add(cr);
  Select query = new Select(select, false, Arrays.asList((TableReference)update.getTable()), update.getWhere(), null, null, null);
  insert = new Insert(update.getTable(), cols, query);

代码示例来源:origin: teiid/teiid

public void visit(Update obj) {
  visitNode(obj.getTable());
  visitNodes(obj.getChanges());
  visitNode(obj.getWhere());
}

代码示例来源:origin: teiid/teiid

public void testGetGroup() throws Exception {
  assertNotNull(example().getTable());
}

代码示例来源:origin: org.teiid.connectors/translator-google

public void visit(Update obj) {
  worksheetTitle = obj.getTable().getName();
  changes = new ArrayList<UpdateSet>();
  String columnName;
  if (obj.getTable().getMetadataObject().getNameInSource() != null) {
    this.worksheetTitle = obj.getTable().getMetadataObject().getNameInSource();
  }
  for (SetClause s : obj.getChanges()) {
    if(s.getSymbol().getMetadataObject().getNameInSource()!=null){
      columnName=s.getSymbol().getMetadataObject().getNameInSource();
    }else{
      columnName=s.getSymbol().getMetadataObject().getName();
    }
    changes.add(new UpdateSet(columnName, getStringValue(s.getValue())));
  }
  translateWhere(obj.getWhere());
}

代码示例来源:origin: org.teiid.connectors/translator-simpledb

@Override
public void visit(Update obj) {
  if (obj.getParameterValues() != null) {
    this.exceptions.add(new TranslatorException(SimpleDBPlugin.Event.TEIID24006, SimpleDBPlugin.Util.gs(SimpleDBPlugin.Event.TEIID24006)));
  }
  
  this.table = obj.getTable().getMetadataObject();
  for(SetClause setClause : obj.getChanges()){
    visitNode(setClause);
  }
  if (obj.getWhere() != null) {
    this.criteria = SimpleDBSQLVisitor.getSQLString(obj.getWhere());
  }
}

代码示例来源:origin: org.teiid.connectors/translator-odata4

@Override
public void visit(Update obj) {
  this.operationType = OperationType.UPDATE;
  visitNode(obj.getTable());
  this.odataQuery.setCondition(obj.getWhere());
  
  try {
    // read the properties
    int elementCount = obj.getChanges().size();
    for (int i = 0; i < elementCount; i++) {
      Column column = obj.getChanges().get(i).getSymbol().getMetadataObject();            
      String type = ODataTypeManager.odataType(column)
          .getFullQualifiedName().getFullQualifiedNameAsString();
      Expression expr = obj.getChanges().get(i).getValue();
      Object value = resolveExpressionValue(expr);
      this.odataQuery.addUpdateProperty(column, type, value);
    }
  } catch (TranslatorException e) {
    this.exceptions.add(e);
  }            
}

代码示例来源:origin: org.teiid.connectors/translator-mongodb

@Override
public void visit(Update obj) {
  this.condition = obj.getWhere();
  append(obj.getTable());
            && this.mongoDoc.isPartOfPrimaryKey(colName)) {
          throw new TranslatorException(MongoDBPlugin.Event.TEIID18035, MongoDBPlugin.Util.gs(
              MongoDBPlugin.Event.TEIID18035, colName, obj.getTable().getName()));
        } else if (this.mongoDoc.getMergeKey().getAssociation() == Association.MANY
            && this.mongoDoc.isPartOfForeignKey(colName)) {
          throw new TranslatorException(MongoDBPlugin.Event.TEIID18036, MongoDBPlugin.Util.gs(
              MongoDBPlugin.Event.TEIID18036, colName, obj.getTable().getName()));
      this.mongoDoc.updateReferenceColumnValue(obj.getTable().getName(), colName, value);

相关文章