1 28 29 package com.caucho.amber.expr; 30 31 import com.caucho.amber.entity.EntityItem; 32 import com.caucho.amber.manager.AmberConnection; 33 import com.caucho.amber.query.FromItem; 34 import com.caucho.amber.query.QueryParseException; 35 import com.caucho.amber.query.QueryParser; 36 import com.caucho.amber.type.Type; 37 import com.caucho.util.CharBuffer; 38 39 import java.sql.ResultSet ; 40 import java.sql.SQLException ; 41 42 45 public interface AmberExpr { 46 public final static int USES_DATA = 0; 47 public final static int IS_INNER_JOIN = 1; 48 49 52 boolean isBoolean(); 53 54 57 Type getType(); 58 59 62 AmberExpr bindSelect(QueryParser parser); 63 64 67 boolean usesFrom(FromItem from, int type); 68 69 72 boolean usesFrom(FromItem from, int type, boolean isNot); 73 74 78 boolean exists(FromItem from); 79 80 87 boolean exists(); 88 89 92 AmberExpr replaceJoin(JoinExpr join); 93 94 97 void generateWhere(CharBuffer cb); 98 99 102 void generateUpdateWhere(CharBuffer cb); 103 104 107 void generateHaving(CharBuffer cb); 108 109 112 void generateJoin(CharBuffer cb); 113 114 117 void generateSelect(CharBuffer cb); 118 119 122 public AmberExpr createBoolean() 123 throws QueryParseException; 124 125 128 public Object getObject(AmberConnection aConn, ResultSet rs, int index) 129 throws SQLException ; 130 131 134 public Object getCacheObject(AmberConnection aConn, 135 ResultSet rs, int index) 136 throws SQLException ; 137 138 141 public EntityItem findItem(AmberConnection aConn, 142 ResultSet rs, int index) 143 throws SQLException ; 144 } 145 | Popular Tags |