public PlanNode getFirstChild() { if ( getChildCount() > 0 ) { return this.children.getFirst(); } return null; }
public PlanNode getFirstChild() { if ( getChildCount() > 0 ) { return this.children.getFirst(); } return null; }
public PlanNode getLastChild() { if ( getChildCount() > 0 ) { return this.children.getLast(); } return null; }
public PlanNode getLastChild() { if ( getChildCount() > 0 ) { return this.children.getLast(); } return null; }
public PlanNode getFirstChild() { if ( getChildCount() > 0 ) { return this.children.getFirst(); } return null; }
public PlanNode getLastChild() { if ( getChildCount() > 0 ) { return this.children.getLast(); } return null; }
static boolean isSingleTable(PlanNode planNode) { return planNode.getChildCount() == 0 || NodeEditor.findAllNodes(planNode, NodeConstants.Types.SOURCE, NodeConstants.Types.JOIN | NodeConstants.Types.SET_OP).size() == 1; }
/** * all of child's children become children of parent */ public static final void removeChildNode(PlanNode parent, PlanNode child) { if (child.getChildCount() == 0) { parent.removeChild(child); } else if (child.getChildCount() == 1){ PlanNode grandChild = child.getFirstChild(); parent.replaceChild(child, grandChild); } else { throw new AssertionError("Cannot promote a multinode child"); //$NON-NLS-1$ } }
/** * all of child's children become children of parent */ public static final void removeChildNode(PlanNode parent, PlanNode child) { if (child.getChildCount() == 0) { parent.removeChild(child); } else if (child.getChildCount() == 1){ PlanNode grandChild = child.getFirstChild(); parent.replaceChild(child, grandChild); } else { throw new AssertionError("Cannot promote a multinode child"); //$NON-NLS-1$ } }
/** * all of child's children become children of parent */ public static final void removeChildNode(PlanNode parent, PlanNode child) { if (child.getChildCount() == 0) { parent.removeChild(child); } else if (child.getChildCount() == 1){ PlanNode grandChild = child.getFirstChild(); parent.replaceChild(child, grandChild); } else { throw new AssertionError("Cannot promote a multinode child"); //$NON-NLS-1$ } }
/** * Add the node as this node's parent. * @param node */ public void addAsParent(PlanNode node) { modified = true; if (this.parent != null) { this.parent.replaceChild(this, node); } assert node.getChildCount() == 0; node.addLastChild(this); }
/** * Add the node as this node's parent. * @param node */ public void addAsParent(PlanNode node) { modified = true; if (this.parent != null) { this.parent.replaceChild(this, node); } assert node.getChildCount() == 0; node.addLastChild(this); }
/** * Add the node as this node's parent. NOTE: This node * must already have a parent. * @param node */ public void addAsParent(PlanNode node) { modified = true; if (this.parent != null) { this.parent.replaceChild(this, node); } assert node.getChildCount() == 0; node.addLastChild(this); }
private boolean visitChildern(PlanNode node, Set<Criteria>[] criteriaInfo, boolean changedTree, QueryMetadataInterface metadata, boolean underAccess) { if (node.getChildCount() > 0) { underAccess |= node.getType() == NodeConstants.Types.ACCESS; List<PlanNode> children = node.getChildren(); for (int i = 0; i < children.size(); i++) { PlanNode childNode = children.get(i); changedTree |= tryToCopy(childNode, i==0?criteriaInfo:new Set[2], metadata, underAccess); } } return changedTree; }
static boolean isProcedure(PlanNode projectNode) { if(projectNode != null && projectNode.getType() == NodeConstants.Types.PROJECT && projectNode.getChildCount() > 0) { PlanNode accessNode = projectNode.getFirstChild(); Command command = getNonQueryCommand(accessNode); return command instanceof StoredProcedure; } return false; }
static boolean isProcedure(PlanNode projectNode) { if(projectNode != null && projectNode.getType() == NodeConstants.Types.PROJECT && projectNode.getChildCount() > 0) { PlanNode accessNode = projectNode.getFirstChild(); Command command = getNonQueryCommand(accessNode); return command instanceof StoredProcedure; } return false; }
static boolean isProcedure(PlanNode projectNode) { if(projectNode != null && projectNode.getType() == NodeConstants.Types.PROJECT && projectNode.getChildCount() > 0) { PlanNode accessNode = projectNode.getFirstChild(); Command command = getNonQueryCommand(accessNode); return command instanceof StoredProcedure; } return false; }
private static final void findAllNodesHelper(PlanNode node, int types, List<PlanNode> foundNodes, int stopTypes) { if((node.getType() & types) == node.getType()) { foundNodes.add(node); } if(node.getChildCount() > 0 && (stopTypes == NodeConstants.Types.NO_TYPE || (stopTypes & node.getType()) != node.getType() ) ) { for (PlanNode child : node.getChildren()) { findAllNodesHelper(child, types, foundNodes, stopTypes); } } }
private static final void findAllNodesHelper(PlanNode node, int types, List<PlanNode> foundNodes, int stopTypes) { if((node.getType() & types) == node.getType()) { foundNodes.add(node); } if(node.getChildCount() > 0 && (stopTypes == NodeConstants.Types.NO_TYPE || (stopTypes & node.getType()) != node.getType() ) ) { for (PlanNode child : node.getChildren()) { findAllNodesHelper(child, types, foundNodes, stopTypes); } } }
private static final void findAllNodesHelper(PlanNode node, int types, List<PlanNode> foundNodes, int stopTypes) { if((node.getType() & types) == node.getType()) { foundNodes.add(node); } if(node.getChildCount() > 0 && (stopTypes == NodeConstants.Types.NO_TYPE || (stopTypes & node.getType()) != node.getType() ) ) { for (PlanNode child : node.getChildren()) { findAllNodesHelper(child, types, foundNodes, stopTypes); } } }