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

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

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

Function.<init>介绍

暂无

代码示例

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

public Function createFunction(String functionName, List<? extends Expression> args, Class<?> type) {
  return new Function(functionName, args, type);
}

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

@Override
public Expression translateGeometrySelect(Expression expr) {
  return new Function(SourceSystemFunctions.ST_ASEWKB, Arrays.asList(expr), TypeFacility.RUNTIME_TYPES.VARBINARY);
}

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

/**
 * Translate GEOMETRY column reference into an expression that 
 * will return WKB and possibly the SRID.
 * 
 * @param expr
 * @return 
 */
public Expression translateGeometrySelect(Expression expr) {
  return new Function(SourceSystemFunctions.ST_ASBINARY, Arrays.asList(expr), TypeFacility.RUNTIME_TYPES.BLOB);
}

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

@Override
public Expression translateGeometrySelect(Expression expr) {
  return new Function(SourceSystemFunctions.ST_ASGML, Arrays.asList(expr), TypeFacility.RUNTIME_TYPES.CLOB);
}

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

public Function createFunction(String functionName, Expression[] args, Class<?> type) {
  return new Function(functionName, Arrays.asList(args), type);
}

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

@Override
public Expression translateGeometrySelect(Expression expr) {
  return new Function(SourceSystemFunctions.ST_ASEWKB, Arrays.asList(expr), TypeFacility.RUNTIME_TYPES.BLOB);
}

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

private Function toNChar(Expression ex) {
  return new Function(TO_NCHAR, Arrays.asList(ex), TypeFacility.RUNTIME_TYPES.STRING);
}

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

@Override
public Expression translateGeographySelect(Expression expr) {
  return new Function(SourceSystemFunctions.ST_ASEWKB, Arrays.asList(
      new Function("CAST", //$NON-NLS-1$
          Arrays.asList(expr, new Literal("geometry", TypeFacility.RUNTIME_TYPES.STRING)), //$NON-NLS-1$ 
          TypeFacility.RUNTIME_TYPES.GEOMETRY)),   
      TypeFacility.RUNTIME_TYPES.VARBINARY); 
}

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

@Override
public Expression translateGeographySelect(Expression expr) {
  return new Function(SourceSystemFunctions.ST_ASEWKB, Arrays.asList(
      new Function("CAST", //$NON-NLS-1$
          Arrays.asList(expr, new Literal("geometry", TypeFacility.RUNTIME_TYPES.STRING)), //$NON-NLS-1$ 
          TypeFacility.RUNTIME_TYPES.GEOMETRY)),   
      TypeFacility.RUNTIME_TYPES.BLOB); 
}

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

@Override
  public List<?> translate(Function function) {
    Expression ex = function.getParameters().get(0);
    if (ex instanceof Parameter || ex instanceof Literal) {
      function.getParameters().set(0, new Function("TO_BLOB", Arrays.asList(ex), TypeFacility.RUNTIME_TYPES.BLOB)); //$NON-NLS-1$
    }
    return super.translate(function);
  }
});

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

@Override
  public List<?> translate(Function function) {
    Expression ex = function.getParameters().get(0);
    if (ex instanceof Parameter || ex instanceof Literal) {
      function.getParameters().set(0, new Function("TO_CLOB", Arrays.asList(ex), TypeFacility.RUNTIME_TYPES.CLOB)); //$NON-NLS-1$
    }
    return super.translate(function);
  }
});

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

@Override
  public List<?> translate(Function function) {
    if (function.getParameters().size() != 3) {
      return null;
    }
    Expression param2 = function.getParameters().get(1);
    
    param2 = new Function(SourceSystemFunctions.ADD_OP, Arrays.asList(param2, new Literal(1, TypeFacility.RUNTIME_TYPES.INTEGER)), TypeFacility.RUNTIME_TYPES.INTEGER); 
    function.getParameters().set(1, param2);
    return null;
  }
});

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

@Override
  public List<?> translate(Function function) {
    if (function.getParameters().size() != 3) {
      return null;
    }
    Expression param2 = function.getParameters().get(1);
    
    param2 = new Function(SourceSystemFunctions.ADD_OP, Arrays.asList(param2, new Literal(1, TypeFacility.RUNTIME_TYPES.INTEGER)), TypeFacility.RUNTIME_TYPES.INTEGER); 
    function.getParameters().set(1, param2);
    return null;
  }
});

代码示例来源: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-jdbc

@Override
  public List<?> translate(Function function) {
    if (function.getParameters().size() > 1) {
      Expression ex = function.getParameters().get(0);
      if (ex.getType() == TypeFacility.RUNTIME_TYPES.DOUBLE || ex.getType() == TypeFacility.RUNTIME_TYPES.FLOAT) {
        if (function.getParameters().get(1) instanceof Literal && Integer.valueOf(0).equals(((Literal)function.getParameters().get(1)).getValue())) {
          function.getParameters().remove(1);
        } else {
          function.getParameters().set(0, new Function(SourceSystemFunctions.CONVERT, Arrays.asList(ex, new Literal("bigdecimal", TypeFacility.RUNTIME_TYPES.STRING)), TypeFacility.RUNTIME_TYPES.BIG_DECIMAL)); //$NON-NLS-1$
        }
      }
    }
    return null;
  }
});

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

isNegative = value < 0;
Function length = new Function(
    SourceSystemFunctions.LENGTH,
    Arrays.asList(function.getParameters().get(0)),
SearchedCase adjustedFrom = new SearchedCase(Arrays.asList(new SearchedWhenClause(new Comparison(from, length, Operator.GT), new Function(
    SourceSystemFunctions.ADD_OP,
    Arrays.asList(
function.getParameters().set(1, adjustedFrom);
Expression maxLength = new Function(
    SourceSystemFunctions.SUBTRACT_OP,
    Arrays.asList(length,
          new Function(
            SourceSystemFunctions.SUBTRACT_OP,
            Arrays.asList(

代码示例来源:origin: org.teiid/teiid-engine

params.set(1, new org.teiid.language.Function(SourceSystemFunctions.CONVERT, 
          Arrays.asList(params.get(1), new Literal(DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataClasses.STRING)), DataTypeManager.DefaultDataClasses.INTEGER));
org.teiid.language.Function result = new org.teiid.language.Function(name, params, function.getType());
if (function.getFunctionDescriptor() != null) {
  result.setMetadataObject(function.getFunctionDescriptor().getMethod());

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

params.set(1, new org.teiid.language.Function(SourceSystemFunctions.CONVERT, 
          Arrays.asList(params.get(1), new Literal(DataTypeManager.DefaultDataTypes.INTEGER, DataTypeManager.DefaultDataClasses.STRING)), DataTypeManager.DefaultDataClasses.INTEGER));
org.teiid.language.Function result = new org.teiid.language.Function(name, params, function.getType());
if (function.getFunctionDescriptor() != null) {
  result.setMetadataObject(function.getFunctionDescriptor().getMethod());

代码示例来源:origin: org.jboss.teiid/teiid-engine

org.teiid.language.Function result = new org.teiid.language.Function(name, params, function.getType());
if (function.getFunctionDescriptor() != null) {
  result.setMetadataObject(function.getFunctionDescriptor().getMethod());

相关文章