@Override public Tree dupNode() { IdentificationVariableNode result = new IdentificationVariableNode(token, variableName); dupChildren(result); return result; }
public void replaceEntityName(String newEntityName, IdentificationVariableNode identificationVariable) { if (identificationVariable != null) { identificationVariable.deleteChild(0); identificationVariable.addChild(new CommonTree(new CommonToken(JPA2Lexer.WORD, newEntityName))); identificationVariable.freshenParentAndChildIndexes(); } }
@Override public boolean supportsJoinTo(IdentificationVariableNode node) { return entityName.equals(node.getEffectiveEntityName()) || entityName.equals(node.getEntityNameFromQuery()); }
@Override public boolean supportsJoinTo(IdentificationVariableNode node) { return pathStartingEntityName.equals(node.getEffectiveEntityName()) && pathNode.getEntityVariableName().equals(node.getVariableName()); }
Deque<QueryVariableContext> stack, List<ErrorRec> invalidIdVarNodes) { List children = getChildren(); String variableName = getVariableName(); queryVC = stack.removeLast(); } while (!queryVC.isPropagateVariablesUpstairs()); deductFields(queryVC, child0, model); stack.peekLast().addEntityVariable(variableName, queryVC.getEntity()); } else {
@Override public Object post(Object t) { if (!(t instanceof CommonTree)) return t; if (t instanceof CommonErrorNode) { return t; } CommonTree node = (CommonTree) t; if (node.token == null) return t; if ((node instanceof QueryNode) && isInWhereSubquery(node)) { stack.peekLast().setPropagateVariablesUp(false); return t; } if (node instanceof IdentificationVariableNode) { IdentificationVariableNode vnode = (IdentificationVariableNode) node; vnode.identifyVariableEntity(model, stack, invalidIdVarNodes); return t; } if (node instanceof BaseJoinNode) { BaseJoinNode vnode = (BaseJoinNode) node; vnode.identifyVariableEntity(model, stack, invalidIdVarNodes); return t; } return t; }
@Override public boolean supportsJoinTo(IdentificationVariableNode node) { return entityName.equals(node.getEffectiveEntityName()); }
public String getEntityNameFromQuery() { return getChild(0).getText(); }
root_1 = (Object)adaptor.becomeRoot(new IdentificationVariableNode(T_ID_VAR, (identification_variable27!=null?input.toString(identification_variable27.start,identification_variable27.stop):null)), root_1); adaptor.addChild(root_1, stream_entity_name.nextTree()); adaptor.addChild(root_0, root_1);
@Override public Object post(Object t) { if (!(t instanceof CommonTree)) return t; if (t instanceof CommonErrorNode) { return t; } CommonTree node = (CommonTree) t; if (node.token == null) return t; if ((node instanceof QueryNode) && node.getParent() != null && "T_CONDITION".equals(((CommonTree) node.getParent()).token.getText())) { stack.peekLast().setPropagateVariablesUp(false); return t; } if (node instanceof IdentificationVariableNode) { IdentificationVariableNode vnode = (IdentificationVariableNode) node; vnode.identifyVariableEntity(model, stack, invalidIdVarNodes); return t; } if (node instanceof JoinVariableNode) { JoinVariableNode vnode = (JoinVariableNode) node; vnode.identifyVariableEntity(model, stack, invalidIdVarNodes); return t; } return t; }
protected void resolveEntityNames(Set<String> entityNames, IdentificationVariableNode node, DomainModel model, QueryVariableContext queryVariableContext) { entityNames.add(node.getEffectiveEntityName()); }