use of org.apache.derby.impl.sql.compile.QueryTreeNode in project derby by apache.
the class DataDictionaryImpl method getTransitionVariables.
/**
* Get all columns that reference transition variables in triggers.
* The columns should be returned in the same order as in the SQL text.
*
* @param node the node in which to look for transition variables
* @param oldReferencingName the name of the old transition variable
* @param newReferencingName the name of the new transition variable
* @return all references to transition variables
*/
private static SortedSet<ColumnReference> getTransitionVariables(Visitable node, String oldReferencingName, String newReferencingName) throws StandardException {
// First get all column references.
SortedSet<ColumnReference> refs = ((QueryTreeNode) node).getOffsetOrderedNodes(ColumnReference.class);
// Then remove all that are not referencing a transition variable.
Iterator<ColumnReference> it = refs.iterator();
while (it.hasNext()) {
TableName tableName = it.next().getQualifiedTableName();
if (!isTransitionVariable(tableName, oldReferencingName, newReferencingName)) {
it.remove();
}
}
// variables.
return refs;
}
Aggregations