use of javax.jcr.query.qom.EquiJoinCondition in project jackrabbit-oak by apache.
the class QomTest method equiJoinCondition.
@Test
public void equiJoinCondition() throws RepositoryException {
EquiJoinCondition e = f.equiJoinCondition("selector1Name", "property1Name", "selector2Name", "property2Name");
assertEquals("selector1Name", e.getSelector1Name());
assertEquals("property1Name", e.getProperty1Name());
assertEquals("selector2Name", e.getSelector2Name());
assertEquals("property2Name", e.getProperty2Name());
assertEquals("[selector1Name].[property1Name] = [selector2Name].[property2Name]", e.toString());
}
use of javax.jcr.query.qom.EquiJoinCondition in project jackrabbit by apache.
the class QueryObjectModelFactoryTest method testJoin.
/**
* Test case for {@link QueryObjectModelFactory#join(Source, Source, String, JoinCondition)}
*/
public void testJoin() throws RepositoryException {
Selector s1 = qf.selector(ntBase, SELECTOR_NAME1);
Selector s2 = qf.selector(testNodeType, SELECTOR_NAME1);
JoinCondition cond = qf.equiJoinCondition(ntBase, jcrPrimaryType, testNodeType, jcrPrimaryType);
for (Iterator<String> it = JOIN_TYPES.iterator(); it.hasNext(); ) {
String joinType = it.next();
Join join = qf.join(s1, s2, joinType, cond);
assertTrue("Not a selector source", join.getLeft() instanceof Selector);
assertTrue("Not a selector source", join.getRight() instanceof Selector);
assertEquals("Wrong join type", joinType, join.getJoinType());
assertTrue("Not an EquiJoinCondition", join.getJoinCondition() instanceof EquiJoinCondition);
}
}
use of javax.jcr.query.qom.EquiJoinCondition in project jackrabbit by apache.
the class QueryObjectModelFactoryTest method testEquiJoinCondition.
/**
* Test case for {@link QueryObjectModelFactory#equiJoinCondition(String, String, String, String)}
*/
public void testEquiJoinCondition() throws RepositoryException {
EquiJoinCondition cond = qf.equiJoinCondition(SELECTOR_NAME1, propertyName1, SELECTOR_NAME2, propertyName2);
assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getSelector1Name());
assertEquals("Wrong property name", propertyName1, cond.getProperty1Name());
assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getSelector2Name());
assertEquals("Wrong property name", propertyName2, cond.getProperty2Name());
}
Aggregations