1 2 12 package com.versant.core.jdbc.sql.exp; 13 14 import com.versant.core.jdbc.sql.SqlDriver; 15 import com.versant.core.util.CharBuf; 16 17 20 public class AggregateExp extends UnaryExp { 21 private String type; 22 private String asValue; 23 24 public AggregateExp(SqlExp child, String type) { 25 super(child); 26 this.type = type; 27 } 28 29 public AggregateExp(SqlExp child, String type, String asValue) { 30 super(child); 31 this.type = type; 32 this.asValue = asValue; 33 } 34 35 public String getAsValue() { 36 return asValue; 37 } 38 39 public void setAsValue(String asValue) { 40 this.asValue = asValue; 41 } 42 43 50 public void appendSQLImp(SqlDriver driver, CharBuf s, SqlExp leftSibling) { 51 s.append(type); 52 s.append("("); 53 childList.appendSQL(driver, s, null); 54 s.append(')'); 55 56 if (asValue != null) { 57 s.append(" as " + asValue); 58 } 59 } 60 61 62 } 63 | Popular Tags |