mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for exprList
This commit is contained in:
@@ -74,4 +74,5 @@ public class SQLOrderBy extends SQLObjectImpl {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLExpr;
|
||||
import com.alibaba.druid.sql.ast.SQLExprImpl;
|
||||
import com.alibaba.druid.sql.ast.SQLOrderBy;
|
||||
import com.alibaba.druid.sql.ast.SQLOver;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
|
||||
@@ -31,9 +32,9 @@ public class SQLAggregateExpr extends SQLExprImpl implements Serializable {
|
||||
protected Option option;
|
||||
protected final List<SQLExpr> arguments = new ArrayList<SQLExpr>();
|
||||
protected SQLOver over;
|
||||
protected SQLOrderBy withinGroup;
|
||||
|
||||
public SQLAggregateExpr(String methodName){
|
||||
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
@@ -50,6 +51,18 @@ public class SQLAggregateExpr extends SQLExprImpl implements Serializable {
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
public SQLOrderBy getWithinGroup() {
|
||||
return withinGroup;
|
||||
}
|
||||
|
||||
public void setWithinGroup(SQLOrderBy withinGroup) {
|
||||
if (withinGroup != null) {
|
||||
withinGroup.setParent(this);
|
||||
}
|
||||
|
||||
this.withinGroup = withinGroup;
|
||||
}
|
||||
|
||||
public Option getOption() {
|
||||
return this.option;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ public class SQLSelectOrderByItem extends SQLObjectImpl {
|
||||
protected SQLExpr expr;
|
||||
protected String collate;
|
||||
protected SQLOrderingSpecification type;
|
||||
protected NullsOrderType nullsOrderType;
|
||||
|
||||
public SQLSelectOrderByItem(){
|
||||
|
||||
@@ -60,6 +61,14 @@ public class SQLSelectOrderByItem extends SQLObjectImpl {
|
||||
public void setType(SQLOrderingSpecification type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public NullsOrderType getNullsOrderType() {
|
||||
return this.nullsOrderType;
|
||||
}
|
||||
|
||||
public void setNullsOrderType(NullsOrderType nullsOrderType) {
|
||||
this.nullsOrderType = nullsOrderType;
|
||||
}
|
||||
|
||||
protected void accept0(SQLASTVisitor visitor) {
|
||||
if (visitor.visit(this)) {
|
||||
@@ -95,4 +104,19 @@ public class SQLSelectOrderByItem extends SQLObjectImpl {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static enum NullsOrderType {
|
||||
NullsFirst, NullsLast;
|
||||
|
||||
public String toFormalString() {
|
||||
if (NullsFirst.equals(this)) {
|
||||
return "NULLS FIRST";
|
||||
}
|
||||
|
||||
if (NullsLast.equals(this)) {
|
||||
return "NULLS LAST";
|
||||
}
|
||||
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user