1 28 29 package com.caucho.amber.expr; 30 31 import com.caucho.amber.query.FromItem; 32 import com.caucho.amber.query.QueryParser; 33 import com.caucho.amber.query.SelectQuery; 34 import com.caucho.util.CharBuffer; 35 36 39 public class SubSelectExpr extends AbstractAmberExpr { 40 private SelectQuery _query; 41 42 public SubSelectExpr(SelectQuery query) 43 { 44 _query = query; 45 } 46 47 50 public AmberExpr bindSelect(QueryParser parser) 51 { 52 return this; 53 } 54 55 58 public boolean usesFrom(FromItem from, int type) 59 { 60 return _query.usesFrom(from, type); 61 } 62 63 66 public void generateWhere(CharBuffer cb) 67 { 68 cb.append('('); 69 cb.append(_query.generateLoadSQL()); 70 cb.append(')'); 71 } 72 73 76 public void generateUpdateWhere(CharBuffer cb) 77 { 78 generateWhere(cb); 79 } 80 81 84 public void generateHaving(CharBuffer cb) 85 { 86 generateWhere(cb); 87 } 88 } 89 | Popular Tags |