本文整理了Java中net.sf.jsqlparser.expression.Function.isDistinct()
方法的一些代码示例,展示了Function.isDistinct()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Function.isDistinct()
方法的具体详情如下:
包路径:net.sf.jsqlparser.expression.Function
类名称:Function
方法名:isDistinct
[英]true if the function is "distinct"
[中]如果函数是“不同的”,则为true
代码示例来源:origin: alibaba/mdrill
public String toString() {
String params = "";
if(allColumns) {
params = "(*)";
}
else if(parameters != null) {
params = parameters.toString();
if (isDistinct()) {
params = params.replaceFirst("\\(", "(DISTINCT ");
}
}
String ans = name+""+params+"";
if(isEscaped) {
ans = "{fn "+ans+"}";
}
return ans;
}
}
代码示例来源:origin: alibaba/mdrill
public void visit(Function function) {
if (function.isEscaped()) {
buffer.append("{fn ");
}
buffer.append(function.getName());
if (function.isAllColumns()) {
buffer.append("(*)");
} else if (function.getParameters() == null) {
buffer.append("()");
} else {
boolean oldUseBracketsInExprList = useBracketsInExprList;
if (function.isDistinct()) {
useBracketsInExprList = false;
buffer.append("(DISTINCT ");
}
visit(function.getParameters());
useBracketsInExprList = oldUseBracketsInExprList;
if (function.isDistinct()) {
buffer.append(")");
}
}
if (function.isEscaped()) {
buffer.append("}");
}
}
代码示例来源:origin: JSQLParser/JSqlParser
if(parameters != null){
params = parameters.toString();
if (isDistinct()) {
params = params.replaceFirst("\\(", "(DISTINCT ");
} else if (isAllColumns()) {
代码示例来源:origin: JSQLParser/JSqlParser
} else {
boolean oldUseBracketsInExprList = useBracketsInExprList;
if (function.isDistinct()) {
useBracketsInExprList = false;
buffer.append("(DISTINCT ");
if (function.isDistinct() || function.isAllColumns()) {
buffer.append(")");
代码示例来源:origin: org.opencadc/cadc-jsqlparser-compat
public String toString() {
String params = "";
if(allColumns) {
params = "(*)";
}
else if(parameters != null) {
params = parameters.toString();
if (isDistinct()) {
params = params.replaceFirst("\\(", "(DISTINCT ");
}
}
String ans = name+""+params+"";
if(isEscaped) {
ans = "{fn "+ans+"}";
}
return ans;
}
}
代码示例来源:origin: org.opencadc/cadc-jsqlparser-compat
public void visit(Function function) {
if (function.isEscaped()) {
buffer.append("{fn ");
}
buffer.append(function.getName());
if (function.isAllColumns()) {
buffer.append("(*)");
} else if (function.getParameters() == null) {
buffer.append("()");
} else {
boolean oldUseBracketsInExprList = useBracketsInExprList;
if (function.isDistinct()) {
useBracketsInExprList = false;
buffer.append("(DISTINCT ");
}
visit(function.getParameters());
useBracketsInExprList = oldUseBracketsInExprList;
if (function.isDistinct()) {
buffer.append(")");
}
}
if (function.isEscaped()) {
buffer.append("}");
}
}
代码示例来源:origin: com.eas.platypus/platypus-js-sql-parser
public void visit(Function function) {
if (function.isEscaped()) {
buffer.append(function.getCommentBeginEscaped() != null ? function.getCommentBeginEscaped() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("{fn ");
}
buffer.append(function.getCommentName() != null ? function.getCommentName() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(function.getName());
if (function.isAllColumns()) {
buffer.append(function.getCommentBeginEscaped() != null ? function.getCommentBeginBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("(").append(function.getCommentBeginEscaped() != null ? function.getCommentAllColumns() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("*").append(function.getCommentBeginEscaped() != null ? function.getCommentEndBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(")");
} else if (function.getParameters() == null) {
buffer.append(function.getCommentBeginEscaped() != null ? function.getCommentBeginBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("(").append(function.getCommentEndEscaped() != null ? function.getCommentEndBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(")");
} else {
boolean oldUseBracketsInExprList = useBracketsInExprList;
if (function.isDistinct()) {
useBracketsInExprList = false;
buffer.append(function.getCommentBeginEscaped() != null ? function.getCommentBeginBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("(").append(function.getCommentDistinct() != null ? function.getCommentDistinct() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("Distinct ");
}
visit(function.getParameters());
useBracketsInExprList = oldUseBracketsInExprList;
if (function.isDistinct()) {
buffer.append(function.getCommentBeginEscaped() != null ? function.getCommentEndBracket() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append(")");
}
}
if (function.isEscaped()) {
buffer.append(function.getCommentEndEscaped() != null ? function.getCommentEndEscaped() + " " + ExpressionDeParser.LINE_SEPARATOR : "").append("}");
}
}
代码示例来源:origin: com.github.jsqlparser/jsqlparser
if(parameters != null){
params = parameters.toString();
if (isDistinct()) {
params = params.replaceFirst("\\(", "(DISTINCT ");
} else if (isAllColumns()) {
代码示例来源:origin: com.github.jsqlparser/jsqlparser
} else {
boolean oldUseBracketsInExprList = useBracketsInExprList;
if (function.isDistinct()) {
useBracketsInExprList = false;
buffer.append("(DISTINCT ");
if (function.isDistinct() || function.isAllColumns()) {
buffer.append(")");
代码示例来源:origin: com.eas.platypus/platypus-js-sql-parser
public String toString() {
String params = "";
if (allColumns) {
params = (getCommentBeginBracket() != null ? " " + getCommentBeginBracket() + " " : "") + "("
+ (getCommentAllColumns() != null ? getCommentAllColumns() + " " : "") + "*"
+ (getCommentEndBracket() != null ? " " + getCommentEndBracket() + " " : "") + ")";
} else if (parameters != null) {
params = (getCommentBeginBracket() != null ? " " + getCommentBeginBracket() + " " : "") + parameters.toString();
if (isDistinct()) {
params = params.replaceFirst("\\(", "(" + (getCommentDistinct() != null ? getCommentDistinct() + " " : "")
+ "DISTINCT ");
}
} else {
params = (getCommentBeginBracket() != null ? " " + getCommentBeginBracket() + " " : "") + "("
+ (getCommentEndBracket() != null ? getCommentEndBracket() + " " : "") + ")";
}
String ans = (getCommentName() != null ? getCommentName() + " " : "") + name + "" + params + "";
if (isEscaped) {
ans = (getCommentBeginEscaped() != null ? getCommentBeginEscaped() + " " : "") + "{fn "
+ ans + (getCommentEndEscaped() != null ? " " + getCommentEndEscaped() + " " : "") + "}";
}
return ans;
}
内容来源于网络,如有侵权,请联系作者删除!