improve sql wall

This commit is contained in:
wenshao
2013-08-28 10:25:16 +08:00
parent d36a6eadcc
commit 9b8d165790
20 changed files with 357 additions and 29 deletions
@@ -15,6 +15,10 @@
*/
package com.alibaba.druid.sql.ast.statement;
import java.util.ArrayList;
import java.util.List;
import com.alibaba.druid.sql.ast.SQLHint;
import com.alibaba.druid.sql.ast.SQLObjectImpl;
import com.alibaba.druid.sql.ast.SQLOrderBy;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
@@ -25,10 +29,26 @@ public class SQLSelect extends SQLObjectImpl {
protected SQLSelectQuery query;
protected SQLOrderBy orderBy;
private List<SQLHint> hints;
public SQLSelect(){
}
public List<SQLHint> getHints() {
if (hints == null) {
hints = new ArrayList<SQLHint>(2);
}
return hints;
}
public int getHintsSize() {
if (hints == null) {
return 0;
}
return hints.size();
}
public SQLSelect(SQLSelectQuery query){
this.setQuery(query);
}
@@ -64,6 +84,7 @@ public class SQLSelect extends SQLObjectImpl {
if (visitor.visit(this)) {
acceptChild(visitor, this.query);
acceptChild(visitor, this.orderBy);
acceptChild(visitor, this.hints);
}
visitor.endVisit(this);