1 21 package oracle.toplink.essentials.internal.parsing; 23 24 25 import java.util.Hashtable ; 27 import java.util.Set ; 28 29 import oracle.toplink.essentials.internal.sessions.AbstractSession; 31 import oracle.toplink.essentials.expressions.Expression; 32 import oracle.toplink.essentials.expressions.ExpressionBuilder; 33 34 46 public class GenerationContext { 47 protected AbstractSession session; 48 protected ParseTreeContext parseTreeContext; 49 protected Class baseQueryClass; 50 protected Expression baseExpression; 51 protected Hashtable expressions; 52 protected ParseTree parseTree; 53 protected boolean isNotIndicatedInMemberOf = false; 54 55 protected MemberOfNode memberOfNode = null; 59 60 public GenerationContext() { 61 super(); 62 expressions = new Hashtable (); 63 } 64 65 public GenerationContext(ParseTreeContext newContext, AbstractSession newSession, ParseTree newParseTree) { 66 super(); 67 parseTreeContext = newContext; 68 session = newSession; 69 expressions = new Hashtable (); 70 parseTree = newParseTree; 71 } 72 73 public void addExpression(Expression expression, String aliasName) { 74 expressions.put(aliasName, expression); 75 } 76 77 public Expression expressionFor(String aliasName) { 78 return (Expression)expressions.get(aliasName); 79 } 80 81 public Class getBaseQueryClass() { 82 return baseQueryClass; 83 } 84 85 public ParseTreeContext getParseTreeContext() { 86 return parseTreeContext; 87 } 88 89 public ParseTree getParseTree() { 90 return parseTree; 91 } 92 93 public AbstractSession getSession() { 94 return session; 95 } 96 97 public void setBaseQueryClass(java.lang.Class newBaseQueryClass) { 98 baseQueryClass = newBaseQueryClass; 99 } 100 101 105 public void setBaseExpression(String variable, Expression expr) { 106 baseExpression = expr; 108 109 addExpression(expr, variable); 111 } 112 113 114 public Expression getBaseExpression() { 115 return baseExpression; 116 } 117 118 public void setParseTree(ParseTree parseTree) { 119 this.parseTree = parseTree; 120 } 121 122 public void setParseTreeContext(ParseTreeContext newParseTreeContext) { 123 parseTreeContext = newParseTreeContext; 124 } 125 126 public void setSession(AbstractSession newSession) { 127 session = newSession; 128 } 129 130 public boolean useParallelExpressions() { 133 return false; 134 } 135 136 public boolean shouldCheckSelectNodeBeforeResolving() { 139 return false; 140 } 141 142 public void setMemberOfNode(MemberOfNode newMemberOfNode) { 144 memberOfNode = newMemberOfNode; 145 } 146 147 public MemberOfNode getMemberOfNode() { 148 return memberOfNode; 149 } 150 151 public boolean hasMemberOfNode() { 153 return memberOfNode != null; 154 } 155 156 public boolean shouldUseOuterJoins() { 158 return false; 159 } 160 161 162 public Expression joinVariables(Set variables) { 163 return null; 164 } 165 } 166 | Popular Tags |