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

x33g5p2x  于2022-01-19 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(92)

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

Function.getMetadataObject介绍

暂无

代码示例

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

@Override
  public List<?> translate(Function function) {
    function.setName(SourceSystemFunctions.ADD_OP);
    
    Expression param1 = function.getParameters().get(0);
    Expression param2 = function.getParameters().get(1);
    
    Function indexOf = new Function("indexof", Arrays.asList(param2, param1), TypeFacility.RUNTIME_TYPES.INTEGER); //$NON-NLS-1$
    indexOf.setMetadataObject(function.getMetadataObject());
    function.getParameters().set(0, indexOf);
    function.getParameters().set(1, new Literal(1, TypeFacility.RUNTIME_TYPES.INTEGER));
    return null;
  }
});

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

@Override
  public List<?> translate(Function function) {
    function.setName(SourceSystemFunctions.ADD_OP); 
    
    Expression param1 = function.getParameters().get(0);
    Expression param2 = function.getParameters().get(1);
    
    Function indexOf = new Function("indexof", Arrays.asList(param2, param1), TypeFacility.RUNTIME_TYPES.INTEGER); //$NON-NLS-1$
    indexOf.setMetadataObject(function.getMetadataObject());
    function.getParameters().set(0, indexOf);
    function.getParameters().set(1, new Literal(1, TypeFacility.RUNTIME_TYPES.INTEGER));
    return null;
  }
});

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

FunctionMethod method = obj.getMetadataObject();
if (name.startsWith(method.getCategory())) {
  name = name.substring(method.getCategory().length()+1);

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

private BaseColumn setCurrentExpression(Expression leftExpression) {
  BaseColumn old = currentExpression;
  if (leftExpression instanceof ColumnReference) {
    ColumnReference cr = (ColumnReference)leftExpression;
    currentExpression = cr.getMetadataObject();
  } else if (leftExpression instanceof Function) {
    Function function = (Function)leftExpression;
    currentExpression = function.getMetadataObject().getOutputParameter();
  } else {
    currentExpression = null;
  }
  //we are really looking for the native type, if it's not set then don't bother
  if (currentExpression != null && currentExpression.getNativeType() == null) {
    currentExpression = null;
  }
  return old;
}

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

public void visit(Function obj) {
  FunctionMethod f = obj.getMetadataObject();
  if (f != null) {
    String nativeQuery = f.getProperty(TEIID_NATIVE_QUERY, false);
    if (nativeQuery != null) {
      List<Argument> args = new ArrayList<Argument>(obj.getParameters().size());
      for (Expression p : obj.getParameters()) {
        args.add(new Argument(Direction.IN, p, p.getType(), null));
      }
      parseNativeQueryParts(nativeQuery, args, buffer, this);
      return;
    }
  }
  super.visit(obj);
}

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

&& "boolean".equals(((Function)left).getMetadataObject().getOutputParameter().getRuntimeType())) {
visitComparisonWithBooleanFunction(obj);

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

FunctionMethod method = obj.getMetadataObject();
if (name.startsWith(method.getCategory())) {
  name = name.substring(method.getCategory().length()+1);

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

Boolean avoidProjection = Boolean.valueOf(((Function) teiidExpr).getMetadataObject().getProperty(MongoDBExecutionFactory.AVOID_PROJECTION, false));
return addToProject(mongoExpr, true, columnDetails, processingDerivedColumn||!avoidProjection, projectedName);

相关文章