public SameNodeJoinMerger( Join join, Map<String, PropertyValue> columns, OperandEvaluator evaluator, QueryObjectModelFactory factory, SameNodeJoinCondition condition) throws RepositoryException { super(join, columns, evaluator, factory); this.selector1 = condition.getSelector1Name(); this.selector2 = condition.getSelector2Name(); this.path = condition.getSelector2Path(); }
protected boolean indexAppliesTo( SameNodeJoinCondition condition ) { if (condition.getSelector2Path() != null) { // These are relative to each other ... return false; } // These are exact matches, so these will apply if the index uses 'jcr:uuid' or 'mode:id' properties return defn.appliesToProperty("jcr:uuid") || defn.appliesToProperty("mode:id"); }
protected boolean indexAppliesTo( SameNodeJoinCondition condition ) { if (condition.getSelector2Path() != null) { // These are relative to each other ... return false; } // These are exact matches, so these will apply if the index uses 'jcr:uuid' or 'mode:id' properties return defn.appliesToProperty("jcr:uuid") || defn.appliesToProperty("mode:id"); }
public SameNodeJoinMerger( Join join, Map<String, PropertyValue> columns, OperandEvaluator evaluator, QueryObjectModelFactory factory, SameNodeJoinCondition condition) throws RepositoryException { super(join, columns, evaluator, factory); this.selector1 = condition.getSelector1Name(); this.selector2 = condition.getSelector2Name(); this.path = condition.getSelector2Path(); }
/** * Test case for {@link QueryObjectModelFactory#sameNodeJoinCondition(String, String, String)} */ public void testSameNodeJoinConditionWithPath() throws RepositoryException { SameNodeJoinCondition cond = qf.sameNodeJoinCondition(SELECTOR_NAME1, SELECTOR_NAME2, nodeName1); assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getSelector1Name()); assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getSelector2Name()); assertEquals("Wrong path", nodeName1, cond.getSelector2Path()); }
/** * Test case for {@link QueryObjectModelFactory#sameNodeJoinCondition(String, String, String)} */ public void testSameNodeJoinCondition() throws RepositoryException { SameNodeJoinCondition cond = qf.sameNodeJoinCondition(SELECTOR_NAME1, SELECTOR_NAME2, "."); assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getSelector1Name()); assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getSelector2Name()); assertEquals("Wrong selector path", ".", cond.getSelector2Path()); }
private void append(SameNodeJoinCondition condition) { append("ISSAMENODE("); appendName(condition.getSelector1Name()); append(", "); appendName(condition.getSelector2Name()); if (condition.getSelector2Path() != null) { append(", "); appendPath(condition.getSelector2Path()); } append(")"); }
private void append(SameNodeJoinCondition condition) { append("ISSAMENODE("); appendName(condition.getSelector1Name()); append(", "); appendName(condition.getSelector2Name()); if (condition.getSelector2Path() != null) { append(", "); appendPath(condition.getSelector2Path()); } append(")"); }
private void append(SameNodeJoinCondition condition) { append("ISSAMENODE("); appendName(condition.getSelector1Name()); append(", "); appendName(condition.getSelector2Name()); if (condition.getSelector2Path() != null) { append(", "); appendPath(condition.getSelector2Path()); } append(")"); }
@Test public void sameNodeJoinCondition() throws RepositoryException { SameNodeJoinCondition s = f.sameNodeJoinCondition("selector1Name", "selector2Name", "selector2Path"); assertEquals("selector1Name", s.getSelector1Name()); assertEquals("selector2Name", s.getSelector2Name()); assertEquals("selector2Path", s.getSelector2Path()); assertEquals("ISSAMENODE([selector1Name], [selector2Name], [selector2Path])", s.toString()); }