mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
support oracle connect_by_root
This commit is contained in:
@@ -23,6 +23,7 @@ public class SQLSelectItem extends SQLObjectImpl {
|
||||
|
||||
private SQLExpr expr;
|
||||
private String alias;
|
||||
private boolean connectByRoot = false;
|
||||
|
||||
public SQLSelectItem(){
|
||||
|
||||
@@ -40,6 +41,16 @@ public class SQLSelectItem extends SQLObjectImpl {
|
||||
expr.setParent(this);
|
||||
}
|
||||
}
|
||||
|
||||
public SQLSelectItem(SQLExpr expr, String alias, boolean connectByRoot){
|
||||
this.connectByRoot = connectByRoot;
|
||||
this.expr = expr;
|
||||
this.alias = alias;
|
||||
|
||||
if (expr != null) {
|
||||
expr.setParent(this);
|
||||
}
|
||||
}
|
||||
|
||||
public SQLExpr getExpr() {
|
||||
return this.expr;
|
||||
@@ -61,6 +72,9 @@ public class SQLSelectItem extends SQLObjectImpl {
|
||||
}
|
||||
|
||||
public void output(StringBuffer buf) {
|
||||
if(this.connectByRoot) {
|
||||
buf.append(" CONNECT_BY_ROOT ");
|
||||
}
|
||||
this.expr.output(buf);
|
||||
if ((this.alias != null) && (this.alias.length() != 0)) {
|
||||
buf.append(" AS ");
|
||||
@@ -99,4 +113,12 @@ public class SQLSelectItem extends SQLObjectImpl {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isConnectByRoot() {
|
||||
return connectByRoot;
|
||||
}
|
||||
|
||||
public void setConnectByRoot(boolean connectByRoot) {
|
||||
this.connectByRoot = connectByRoot;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user