@Override public void visit(SameNodeJoinCondition joinCondition) { symbols.add(joinCondition.getSelector1Name()); symbols.add(joinCondition.getSelector2Name()); } }));
/** * {@inheritDoc} * * @see QueryObjectModelVisitor#visit(SameNodeJoinCondition) */ public void visit(SameNodeJoinCondition condition) { append("ISSAMENODE(").append(condition.getSelector1Name()).append(',').append(condition.getSelector2Name()); if (condition.getSelector2Path() != null) { append(',').append(condition.getSelector2Path()); } append(')'); }
/** * Define the join criteria to require the two tables represent the same * node. The supplied tables must be a valid name or alias. * * @param table1 * the name or alias of the first table * @param table2 * the name or alias of the second table * @return the query builder instance, for method chaining purposes */ public QueryBuilder onSameNode(String table1, String table2) { return createJoin(new SameNodeJoinCondition(nameOf(table1), nameOf(table2))); }
/** * @see org.xcmis.search.Visitors.AbstractModelVisitor#visit(org.xcmis.search.model.source.join.SameNodeJoinCondition) */ @Override public void visit(SameNodeJoinCondition node) throws VisitException { checkSelectorExistance(node.getSelector1Name()); checkSelectorExistance(node.getSelector2Name()); if (node.getSelector1Name().equals(node.getSelector2Name())) { problems.addException(new InvalidQueryException(node.getSelector1Name() + " is the same as " + node.getSelector2Name())); } }