1 21 22 package org.apache.derby.impl.sql.compile; 23 24 import org.apache.derby.iapi.services.sanity.SanityManager; 25 import org.apache.derby.iapi.sql.compile.Visitable; 26 import org.apache.derby.iapi.sql.compile.Visitor; 27 28 29 import org.apache.derby.iapi.store.access.Qualifier; 30 import org.apache.derby.iapi.error.StandardException; 31 32 38 public class HasCorrelatedCRsVisitor implements Visitor 39 { 40 private boolean hasCorrelatedCRs; 41 42 45 public HasCorrelatedCRsVisitor() 46 { 47 } 48 49 50 51 57 64 public Visitable visit(Visitable node) 65 { 66 if (node instanceof ColumnReference) 67 { 68 if (((ColumnReference)node).getCorrelated()) 69 { 70 hasCorrelatedCRs = true; 71 } 72 } 73 else if (node instanceof VirtualColumnNode) 74 { 75 if (((VirtualColumnNode)node).getCorrelated()) 76 { 77 hasCorrelatedCRs = true; 78 } 79 } 80 else if (node instanceof MethodCallNode) 81 { 82 84 if (((MethodCallNode)node).getMethodName().equals("getTriggerExecutionContext") || 85 ((MethodCallNode)node).getMethodName().equals("TriggerOldTransitionRows") || 86 ((MethodCallNode)node).getMethodName().equals("TriggerNewTransitionRows") 87 ) 88 { 89 hasCorrelatedCRs = true; 90 } 91 } 92 return node; 93 } 94 95 100 public boolean stopTraversal() 101 { 102 return hasCorrelatedCRs; 103 } 104 105 public boolean skipChildren(Visitable v) 106 { 107 return false; 108 } 109 110 121 public boolean hasCorrelatedCRs() 122 { 123 return hasCorrelatedCRs; 124 } 125 126 131 public void setHasCorrelatedCRs(boolean value) 132 { 133 hasCorrelatedCRs = value; 134 } 135 } 136 | Popular Tags |