*
* @param alias the alias for the "__ALL_NODES" table; may not be null
* @return this builder object, for convenience in method chaining
*/
public QueryBuilder fromAllNodesAs( String alias ) {
AllNodes allNodes = new AllNodes(selector(alias));
SelectorName oldName = this.source instanceof Selector ? ((Selector)source).getName() : null;
// Go through the columns and change the selector name to use the new alias ...
for (int i = 0; i != columns.size(); ++i) {
Column old = columns.get(i);
if (old.getSelectorName().equals(oldName)) {
columns.set(i, new Column(allNodes.getAliasOrName(), old.getPropertyName(), old.getColumnName()));
}
}
this.source = allNodes;
return this;
}