new feature : sql builder

This commit is contained in:
wenshao
2015-06-07 22:36:33 +08:00
parent 7575d5f1ff
commit 3a7d001b93
32 changed files with 921 additions and 125 deletions
@@ -31,8 +31,7 @@ public class SQLOrderBy extends SQLObjectImpl {
public SQLOrderBy(SQLExpr expr){
SQLSelectOrderByItem item = new SQLSelectOrderByItem(expr);
item.setParent(this);
this.items.add(item);
addItem(item);
}
public void addItem(SQLSelectOrderByItem item) {
@@ -71,5 +70,14 @@ public class SQLOrderBy extends SQLObjectImpl {
return items.equals(other.items);
}
public void addItem(SQLExpr expr, SQLOrderingSpecification type) {
SQLSelectOrderByItem item = createItem();
item.setExpr(expr);
item.setType(type);
addItem(item);
}
protected SQLSelectOrderByItem createItem() {
return new SQLSelectOrderByItem();
}
}