本文整理了Java中net.sf.jsqlparser.expression.Function.setParameters()
方法的一些代码示例,展示了Function.setParameters()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Function.setParameters()
方法的具体详情如下:
包路径:net.sf.jsqlparser.expression.Function
类名称:Function
方法名:setParameters
暂无
代码示例来源:origin: baomidou/mybatis-plus
/**
* 获取jsqlparser中count的SelectItem
*/
private static List<SelectItem> countSelectItem() {
Function function = new Function();
function.setName("COUNT");
List<Expression> expressions = new ArrayList<>();
LongValue longValue = new LongValue(1);
ExpressionList expressionList = new ExpressionList();
expressions.add(longValue);
expressionList.setExpressions(expressions);
function.setParameters(expressionList);
List<SelectItem> selectItems = new ArrayList<>();
SelectExpressionItem selectExpressionItem = new SelectExpressionItem(function);
selectItems.add(selectExpressionItem);
return selectItems;
}
}
代码示例来源:origin: alibaba/mdrill
retval.setParameters(expressionList);
retval.setName(funcName);
{if (true) return retval;}
代码示例来源:origin: JSQLParser/JSqlParser
jjtc000 = false;
jjtn000.jjtSetLastToken(getToken(0));
retval.setParameters(expressionList);
retval.setNamedParameters(namedExpressionList);
retval.setName(funcName);
代码示例来源:origin: geotools/geotools
public void visit(Function function) {
Function qfunction = new Function();
qfunction.setAllColumns(function.isAllColumns());
qfunction.setEscaped(function.isEscaped());
qfunction.setName(function.getName());
ExpressionList parameters = function.getParameters();
ExpressionList qualifiedParams;
qualifiedParams =
(ExpressionList) ItemsListQualifier.qualify(session, tableAliases, parameters);
qfunction.setParameters(qualifiedParams);
this._qualifiedExpression = qfunction;
}
代码示例来源:origin: org.opencadc/cadc-adql
@Override
public void visit(Function function)
{
log.debug("visit(function)" + function);
String functionName = function.getName();
String newName = map.get(functionName);
if (newName != null)
function.setName(newName);
// DIST returns radians, we want degrees.
if (function.getName().equals("DIST"))
{
Function dist = new Function();
dist.setName("dist");
dist.setParameters(function.getParameters());
List<Expression> list = new ArrayList<Expression>();
list.add(dist);
ExpressionList parameters = new ExpressionList();
parameters.setExpressions(list);
function.setName("degrees");
function.setParameters(parameters);
}
}
代码示例来源:origin: com.baomidou/mybatis-plus-extension
/**
* <p>
* 获取jsqlparser中count的SelectItem
* </p>
*/
private static List<SelectItem> countSelectItem() {
Function function = new Function();
function.setName("COUNT");
List<Expression> expressions = new ArrayList<>();
LongValue longValue = new LongValue(1);
ExpressionList expressionList = new ExpressionList();
expressions.add(longValue);
expressionList.setExpressions(expressions);
function.setParameters(expressionList);
List<SelectItem> selectItems = new ArrayList<>();
SelectExpressionItem selectExpressionItem = new SelectExpressionItem(function);
selectItems.add(selectExpressionItem);
return selectItems;
}
}
代码示例来源:origin: org.opencadc/cadc-adql
public Lat(Function adqlFunction)
{
super();
Function latFunction = new Function();
latFunction.setName("lat");
latFunction.setParameters(adqlFunction.getParameters());
List<Expression> expressions = new ArrayList<Expression>();
expressions.add(latFunction);
ExpressionList expressionList = new ExpressionList();
expressionList.setExpressions(expressions);
setName("degrees");
setParameters(expressionList);
}
代码示例来源:origin: org.opencadc/cadc-adql
public Longitude(Function adqlFunction)
{
super();
Function longFunction = new Function();
longFunction.setName("long");
longFunction.setParameters(adqlFunction.getParameters());
List<Expression> expressions = new ArrayList<Expression>();
expressions.add(longFunction);
ExpressionList expressionList = new ExpressionList();
expressionList.setExpressions(expressions);
setName("degrees");
setParameters(expressionList);
}
代码示例来源:origin: org.opencadc/cadc-adql
protected void convertParameters()
{
// RA
List<Expression> longExp = new ArrayList<Expression>();
longExp.add(ra);
ExpressionList longParams = new ExpressionList();
longParams.setExpressions(longExp);
Function longFunc = new Function();
longFunc.setName("radians");
longFunc.setParameters(longParams);
// DEC
List<Expression> latExp = new ArrayList<Expression>();
latExp.add(dec);
ExpressionList latParams = new ExpressionList();
latParams.setExpressions(latExp);
// Radius
Function latFunc = new Function();
latFunc.setName("radians");
latFunc.setParameters(latParams);
// Spoint
List<Expression> expressions = new ArrayList<Expression>();
expressions.add(longFunc);
expressions.add(latFunc);
ExpressionList parameters = new ExpressionList();
parameters.setExpressions(expressions);
setName("spoint");
setParameters(parameters);
}
代码示例来源:origin: org.opencadc/cadc-adql
protected void convertParameters()
{
// Spoint
Spoint spoint = new Spoint(coordsys, ra, dec);
List<Expression> radiusExp = new ArrayList<Expression>();
radiusExp.add(radius);
ExpressionList radiusParams = new ExpressionList();
radiusParams.setExpressions(radiusExp);
// Radius
Function radiusFunc = new Function();
radiusFunc.setName("radians");
radiusFunc.setParameters(radiusParams);
// Scircle
List<Expression> expressions = new ArrayList<Expression>();
expressions.add(spoint);
expressions.add(radiusFunc);
ExpressionList parameters = new ExpressionList();
parameters.setExpressions(expressions);
setName("scircle");
setParameters(parameters);
}
代码示例来源:origin: com.manydesigns/portofino-crud
protected String generateCountQuery(String queryString) throws JSQLParserException {
CCJSqlParserManager parserManager = new CCJSqlParserManager();
try {
PlainSelect plainSelect =
(PlainSelect) ((Select) parserManager.parse(new StringReader(queryString))).getSelectBody();
logger.debug("Query string {} contains select");
List items = plainSelect.getSelectItems();
if(items.size() != 1) {
logger.error("I don't know how to generate a count query for {}", queryString);
return null;
}
SelectExpressionItem item = (SelectExpressionItem) items.get(0);
Function function = new Function();
function.setName("count");
function.setParameters(new ExpressionList(Arrays.asList(item.getExpression())));
item.setExpression(function);
plainSelect.setOrderByElements(null);
return plainSelect.toString();
} catch(Exception e) {
logger.debug("Query string {} does not contain select", e);
queryString = "SELECT count(*) " + queryString;
PlainSelect plainSelect =
(PlainSelect) ((Select) parserManager.parse(new StringReader(queryString))).getSelectBody();
plainSelect.setOrderByElements(null);
return plainSelect.toString();
}
}
代码示例来源:origin: ManyDesigns/Portofino
protected String generateCountQuery(String queryString) throws JSQLParserException {
CCJSqlParserManager parserManager = new CCJSqlParserManager();
try {
PlainSelect plainSelect =
(PlainSelect) ((Select) parserManager.parse(new StringReader(queryString))).getSelectBody();
logger.debug("Query string {} contains select");
List items = plainSelect.getSelectItems();
if(items.size() != 1) {
logger.error("I don't know how to generate a count query for {}", queryString);
return null;
}
SelectExpressionItem item = (SelectExpressionItem) items.get(0);
Function function = new Function();
function.setName("count");
function.setParameters(new ExpressionList(Arrays.asList(item.getExpression())));
item.setExpression(function);
plainSelect.setOrderByElements(null);
return plainSelect.toString();
} catch(Exception e) {
logger.debug("Query string {} does not contain select", e);
queryString = "SELECT count(*) " + queryString;
PlainSelect plainSelect =
(PlainSelect) ((Select) parserManager.parse(new StringReader(queryString))).getSelectBody();
plainSelect.setOrderByElements(null);
return plainSelect.toString();
}
}
代码示例来源:origin: org.geotools/gt-arcsde
public void visit(Function function) {
Function qfunction = new Function();
qfunction.setAllColumns(function.isAllColumns());
qfunction.setEscaped(function.isEscaped());
qfunction.setName(function.getName());
ExpressionList parameters = function.getParameters();
ExpressionList qualifiedParams;
qualifiedParams = (ExpressionList) ItemsListQualifier.qualify(session, tableAliases,
parameters);
qfunction.setParameters(qualifiedParams);
this._qualifiedExpression = qfunction;
}
代码示例来源:origin: org.opencadc/cadc-adql
f.setParameters(implExprList);
implExpr = convertToImplementation(f);
代码示例来源:origin: org.opencadc/cadc-jsqlparser-compat
retval.setParameters(expressionList);
retval.setName(funcName);
{if ("" != null) return retval;}
代码示例来源:origin: com.eas.platypus/platypus-js-sql-parser
retval.setParameters(expressionList);
retval.setName(funcName);
{if ("" != null) return retval;}
代码示例来源:origin: com.github.jsqlparser/jsqlparser
jjtc000 = false;
jjtn000.jjtSetLastToken(getToken(0));
retval.setParameters(expressionList);
retval.setNamedParameters(namedExpressionList);
retval.setName(funcName);
内容来源于网络,如有侵权,请联系作者删除!