1 28 29 package com.caucho.db.sql; 30 31 import com.caucho.log.Log; 32 import com.caucho.util.L10N; 33 34 import java.sql.SQLException ; 35 import java.util.ArrayList ; 36 import java.util.logging.Logger ; 37 38 public class ExistsEvalExpr extends Expr { 39 protected static final L10N L = new L10N(ExistsEvalExpr.class); 40 private static final Logger log = Log.open(ExistsEvalExpr.class); 41 42 private ExistsExpr _subselect; 43 44 ExistsEvalExpr(ExistsExpr subselect) 45 { 46 _subselect = subselect; 47 } 48 49 52 public Class getType() 53 { 54 return boolean.class; 55 } 56 57 60 public long subCost(ArrayList <FromItem> fromList) 61 { 62 return _subselect.subCost(fromList) - 1; 63 } 64 65 72 public int evalBoolean(QueryContext context) 73 throws SQLException 74 { 75 _subselect.evaluate(context); 76 77 return TRUE; 78 } 79 80 87 public String evalString(QueryContext context) 88 throws SQLException 89 { 90 throw new UnsupportedOperationException (); 91 } 92 93 public String toString() 94 { 95 return "ExistsEvalExpr[" + _subselect + "]"; 96 } 97 } 98 | Popular Tags |