1 6 package tests.jfun.parsec.mssql; 7 8 13 public final class Select { 14 private final SelectExpr[] select; 15 private final Relation[] from; 16 private final BoolExpression where; 17 private final GroupBy groupby; 18 private final OrderExpr[] orderby; 19 public String toString(){ 20 final StringBuffer buf = new StringBuffer (); 21 buf.append("select ") 22 .append(ShowUtils.showList(select, ",")); 23 if(from!=null) 24 buf.append(" from ").append(ShowUtils.showList(from, ",")); 25 if(where != null) 26 buf.append(" where ").append(where); 27 if(groupby != null) 28 buf.append(" ").append(groupby); 29 if(orderby != null) 30 buf.append(" order by ").append(ShowUtils.showList(orderby, ",")); 31 return buf.toString(); 32 } 33 41 Select(final SelectExpr[] select, final Relation[] from, 42 final BoolExpression where, final GroupBy groupby, 43 final OrderExpr[] orderby) { 44 this.select = select; 45 this.from = from; 46 this.where = where; 47 this.groupby = groupby; 48 this.orderby = orderby; 49 } 50 53 public GroupBy getGroupby() { 54 return groupby; 55 } 56 57 60 public OrderExpr[] getOrderby() { 61 return orderby; 62 } 63 66 public SelectExpr[] getSelect() { 67 return select; 68 } 69 72 public BoolExpression getWhere() { 73 return where; 74 } 75 } 76 | Popular Tags |