Search in sources :

Example 1 with JoinType

use of org.apache.jackrabbit.oak.query.ast.JoinType in project jackrabbit-oak by apache.

the class SQL2Parser method parseSource.

private SourceImpl parseSource() throws ParseException {
    SelectorImpl selector = parseSelector();
    selectors.put(selector.getSelectorName(), selector);
    SourceImpl source = selector;
    while (true) {
        JoinType joinType;
        if (readIf("RIGHT")) {
            read("OUTER");
            joinType = JoinType.RIGHT_OUTER;
        } else if (readIf("LEFT")) {
            read("OUTER");
            joinType = JoinType.LEFT_OUTER;
        } else if (readIf("INNER")) {
            joinType = JoinType.INNER;
        } else {
            break;
        }
        read("JOIN");
        selector = parseSelector();
        selectors.put(selector.getSelectorName(), selector);
        read("ON");
        JoinConditionImpl on = parseJoinCondition();
        source = factory.join(source, selector, joinType, on);
    }
    return source;
}
Also used : SelectorImpl(org.apache.jackrabbit.oak.query.ast.SelectorImpl) SourceImpl(org.apache.jackrabbit.oak.query.ast.SourceImpl) JoinType(org.apache.jackrabbit.oak.query.ast.JoinType) JoinConditionImpl(org.apache.jackrabbit.oak.query.ast.JoinConditionImpl)

Aggregations

JoinConditionImpl (org.apache.jackrabbit.oak.query.ast.JoinConditionImpl)1 JoinType (org.apache.jackrabbit.oak.query.ast.JoinType)1 SelectorImpl (org.apache.jackrabbit.oak.query.ast.SelectorImpl)1 SourceImpl (org.apache.jackrabbit.oak.query.ast.SourceImpl)1