/** * Specify that the query should select from the "__ALLNODES__" built-in table. * * @return this builder object, for convenience in method chaining */ public QueryBuilder fromAllNodes() { this.source = new AllNodes(); return this; }
@Override public void visit( AllNodes allNodes ) { if (allNodes.hasAlias()) { result.put(allNodes.name(), allNodes.aliasOrName()); } }
/** * Specify that the query should select from the "__ALLNODES__" built-in table using the supplied alias. * * @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).name() : 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.selectorName().equals(oldName)) { columns.set(i, new Column(allNodes.aliasOrName(), old.getPropertyName(), old.getColumnName())); } } this.source = allNodes; return this; }
@Override public void visit( AllNodes obj ) { // this table doesn't have to be in the list of selected tables verifyTable(obj.name()); }
@Override public void visit( AllNodes selector ) { if (notFound.get() && selector.aliasOrName().equals(name)) notFound.set(false); }
/** * Specify that the query should select from the "__ALLNODES__" built-in table using the supplied alias. * * @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).name() : 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.selectorName().equals(oldName)) { columns.set(i, new Column(allNodes.aliasOrName(), old.getPropertyName(), old.getColumnName())); } } this.source = allNodes; return this; }
@Override public void visit( AllNodes obj ) { // this table doesn't have to be in the list of selected tables verifyTable(obj.name()); }
@Override public void visit( AllNodes selector ) { if (notFound.get() && selector.aliasOrName().equals(name)) notFound.set(false); }
@Override public void visit( AllNodes allNodes ) { if (allNodes.hasAlias()) { result.put(allNodes.name(), allNodes.aliasOrName()); } }
/** * Specify that the query should select from the "__ALLNODES__" built-in table. * * @return this builder object, for convenience in method chaining */ public QueryBuilder fromAllNodes() { this.source = new AllNodes(); return this; }
@Override public int hashCode() { return name().hashCode(); }
/** * Utility method that does all the work of the clear, but with a flag that defines whether to clear the first query. This * method is used by {@link #clear()} as well as the {@link #union() many} {@link #intersect() set} {@link #except() * operations}. * * @param clearFirstQuery true if the first query should be cleared, or false if the first query should be retained * @return this builder object, for convenience in method chaining */ protected QueryBuilder clear( boolean clearFirstQuery ) { source = new AllNodes(); constraint = null; columns = new LinkedList<Column>(); orderings = new LinkedList<Ordering>(); limit = Limit.NONE; distinct = false; if (clearFirstQuery) { this.firstQuery = null; this.firstQuerySetOperation = null; } return this; }
@Override public int hashCode() { return name().hashCode(); }
/** * Utility method that does all the work of the clear, but with a flag that defines whether to clear the first query. This * method is used by {@link #clear()} as well as the {@link #union() many} {@link #intersect() set} {@link #except() * operations}. * * @param clearFirstQuery true if the first query should be cleared, or false if the first query should be retained * @return this builder object, for convenience in method chaining */ protected QueryBuilder clear( boolean clearFirstQuery ) { source = new AllNodes(); constraint = null; columns = new LinkedList<Column>(); orderings = new LinkedList<Ordering>(); limit = Limit.NONE; distinct = false; if (clearFirstQuery) { this.firstQuery = null; this.firstQuerySetOperation = null; } return this; }