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 import java.util.Map ; 18 19 22 public class OrderExp extends UnaryExp { 23 24 private boolean desc; 25 26 public OrderExp(SqlExp child, boolean desc) { 27 super(child); 28 this.desc = desc; 29 } 30 31 public OrderExp() { 32 } 33 34 public SqlExp createInstance() { 35 return new OrderExp(); 36 } 37 38 public SqlExp getClone(SqlExp clone, Map cloneMap) { 39 super.getClone(clone, cloneMap); 40 41 ((OrderExp) clone).desc = desc; 42 43 return clone; 44 } 45 46 public String toString() { 47 return super.toString() + (desc ? " desc" : ""); 48 } 49 50 57 public void appendSQLImp(SqlDriver driver, CharBuf s, SqlExp leftSibling) { 58 super.appendSQLImp(driver, s, leftSibling); 59 if (desc) s.append(" DESC"); 60 } 61 62 public boolean isDesc() { 63 return desc; 64 } 65 } 66 67 | Popular Tags |