use of com.haulmont.cuba.core.sys.jpql.tree.QueryNode in project cuba by cuba-platform.
the class IdVarSelector method pre.
@Override
public Object pre(Object t) {
if (!(t instanceof CommonTree))
return t;
if (t instanceof CommonErrorNode) {
return t;
}
CommonTree node = (CommonTree) t;
if (node instanceof QueryNode) {
QueryVariableContext newCurrent = new QueryVariableContext(model, (QueryNode) node);
if (root == null) {
root = newCurrent;
}
QueryVariableContext last = stack.peekLast();
if (last != null) {
last.addChild(newCurrent);
}
stack.addLast(newCurrent);
}
return t;
}
use of com.haulmont.cuba.core.sys.jpql.tree.QueryNode in project cuba by cuba-platform.
the class IdVarSelector method post.
@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;
}
use of com.haulmont.cuba.core.sys.jpql.tree.QueryNode in project cuba by cuba-platform.
the class IdVarSelector method post.
@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;
}
use of com.haulmont.cuba.core.sys.jpql.tree.QueryNode in project cuba by cuba-platform.
the class IdVarSelector method pre.
@Override
public Object pre(Object t) {
if (!(t instanceof CommonTree))
return t;
CommonTree node = (CommonTree) t;
if (node instanceof QueryNode) {
QueryVariableContext newCurrent = new QueryVariableContext(model, (QueryNode) node);
if (root == null) {
root = newCurrent;
}
QueryVariableContext last = stack.peekLast();
if (last != null) {
last.addChild(newCurrent);
}
stack.addLast(newCurrent);
}
return t;
}
Aggregations