mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
+18
-7
@@ -20,6 +20,7 @@ import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.ast.SQLName;
|
||||
import com.alibaba.druid.sql.ast.statement.SQLDeleteStatement;
|
||||
import com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlDeleteStatement;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.ast.PGWithClause;
|
||||
import com.alibaba.druid.sql.dialect.postgresql.visitor.PGASTVisitor;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
@@ -28,7 +29,6 @@ import com.alibaba.druid.util.JdbcConstants;
|
||||
public class PGDeleteStatement extends SQLDeleteStatement implements PGSQLStatement {
|
||||
|
||||
private PGWithClause with;
|
||||
private boolean only = false;
|
||||
private List<SQLName> using = new ArrayList<SQLName>(2);
|
||||
private boolean returning;
|
||||
private String alias;
|
||||
@@ -61,13 +61,7 @@ public class PGDeleteStatement extends SQLDeleteStatement implements PGSQLStatem
|
||||
this.using = using;
|
||||
}
|
||||
|
||||
public boolean isOnly() {
|
||||
return only;
|
||||
}
|
||||
|
||||
public void setOnly(boolean only) {
|
||||
this.only = only;
|
||||
}
|
||||
|
||||
public PGWithClause getWith() {
|
||||
return with;
|
||||
@@ -93,4 +87,21 @@ public class PGDeleteStatement extends SQLDeleteStatement implements PGSQLStatem
|
||||
visitor.endVisit(this);
|
||||
}
|
||||
|
||||
public PGDeleteStatement clone() {
|
||||
PGDeleteStatement x = new PGDeleteStatement();
|
||||
cloneTo(x);
|
||||
|
||||
if (with != null) {
|
||||
x.setWith(with.clone());
|
||||
}
|
||||
for (SQLName item : using) {
|
||||
SQLName item2 = item.clone();
|
||||
item2.setParent(x);
|
||||
x.using.add(item2);
|
||||
}
|
||||
x.returning = returning;
|
||||
x.alias = alias;
|
||||
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user