private OrderingImpl[] parseOrder() throws ParseException { ArrayList<OrderingImpl> orderList = new ArrayList<OrderingImpl>(); do { OrderingImpl ordering; DynamicOperandImpl op = parseDynamicOperand(); if (readIf("DESC")) { ordering = factory.descending(op); } else { readIf("ASC"); ordering = factory.ascending(op); } orderList.add(ordering); } while (readIf(",")); OrderingImpl[] orderings = new OrderingImpl[orderList.size()]; orderList.toArray(orderings); return orderings; }
private void addWildcardColumns( Collection<ColumnImpl> columns, SelectorImpl selector) { String selectorName = selector.getSelectorName(); for (String propertyName : selector.getWildcardColumns()) { if (namePathMapper != null) { propertyName = namePathMapper.getJcrName(propertyName); } String columnName; if (includeSelectorNameInWildcardColumns) { columnName = selectorName + "." + propertyName; } else { columnName = propertyName; } columns.add(factory.column(selectorName, propertyName, columnName)); } if (columns.isEmpty()) { // OAK-1354, inject the selector name columns.add(factory .column(selectorName, selectorName, selectorName)); } }
@Override public AstElement copyOf() { return new JoinImpl( (SourceImpl) copyElementAndCheckReference(left), (SourceImpl) copyElementAndCheckReference(right), joinType, (JoinConditionImpl) copyElementAndCheckReference(joinCondition) ); } }
private DynamicOperandImpl parseExpressionFunction(String functionName) throws ParseException { DynamicOperandImpl op; if ("LENGTH".equalsIgnoreCase(functionName)) { op = factory.length(parseDynamicOperand()); } else if ("NAME".equalsIgnoreCase(functionName)) { if (isToken(")")) { op = factory.nodeName(getOnlySelectorName()); } else { op = factory.nodeName(readName()); op = factory.nodeLocalName(getOnlySelectorName()); } else { op = factory.nodeLocalName(readName()); op = factory.fullTextSearchScore(getOnlySelectorName()); } else { op = factory.fullTextSearchScore(readName()); read(","); DynamicOperandImpl op2 = parseDynamicOperand(); op = factory.coalesce(op1, op2); } else if ("LOWER".equalsIgnoreCase(functionName)) { op = factory.lowerCase(parseDynamicOperand()); } else if ("UPPER".equalsIgnoreCase(functionName)) { op = factory.upperCase(parseDynamicOperand()); } else if ("PROPERTY".equalsIgnoreCase(functionName)) { PropertyValueImpl pv = parsePropertyValue(readName()); read(","); op = factory.propertyValue(pv.getSelectorName(), pv.getPropertyName(), readString().getValue(Type.STRING)); } else {
c = factory.fullTextSearch( getOnlySelectorName(), null, parseStaticOperand()); } else if (readIf(".")) { c = factory.fullTextSearch( getOnlySelectorName(), null, parseStaticOperand()); } else { if (readIf("*")) { read(","); c = factory.fullTextSearch( name, null, parseStaticOperand()); } else { name = readName(); read(","); c = factory.fullTextSearch( selector, name, parseStaticOperand()); c = factory.fullTextSearch( getOnlySelectorName(), name, parseStaticOperand()); String name = readName(); if (readIf(",")) { c = factory.sameNode(name, readAbsolutePath()); } else { c = factory.sameNode(getOnlySelectorName(), name);
String selector2 = readName(); if (readIf(",")) { c = factory.sameNodeJoinCondition(selector1, selector2, readPath()); } else { c = factory.sameNodeJoinCondition(selector1, selector2, "."); c = factory.childNodeJoinCondition(childSelector, readName()); } else if ("ISDESCENDANTNODE".equalsIgnoreCase(name)) { String descendantSelector = readName(); read(","); c = factory.descendantNodeJoinCondition(descendantSelector, readName()); } else { throw getSyntaxError("ISSAMENODE, ISCHILDNODE, or ISDESCENDANTNODE"); String selector2 = readName(); read("."); return factory.equiJoinCondition(selector1, property1, selector2, readName());
private ConstraintImpl parseCondition() throws ParseException { ConstraintImpl a; if (readIf("NOT")) { a = factory.not(parseCondition()); } else if (readIf("(")) { a = parseConstraint(); a = parseCondition(factory.propertyValue(identifier, readName())); } else { a = parseCondition(factory.propertyValue(getOnlySelectorName(), identifier)); a = parseCondition(factory.propertyValue(name, readName())); } else { a = parseCondition(factory.propertyValue(getOnlySelectorName(), name)); if (readIf("IN")) { DynamicOperandImpl right = parseDynamicOperand(); ConstraintImpl c = factory.comparison(right, Operator.EQUAL, left); return c; } else {
private ConstraintImpl parseCondition(DynamicOperandImpl left) throws ParseException { ConstraintImpl c; if (readIf("=")) { c = factory.comparison(left, Operator.EQUAL, parseStaticOperand()); } else if (readIf("<>")) { c = factory.comparison(left, Operator.NOT_EQUAL, parseStaticOperand()); } else if (readIf("<")) { c = factory.comparison(left, Operator.LESS_THAN, parseStaticOperand()); } else if (readIf(">")) { c = factory.comparison(left, Operator.GREATER_THAN, parseStaticOperand()); } else if (readIf("<=")) { c = factory.comparison(left, Operator.LESS_OR_EQUAL, parseStaticOperand()); } else if (readIf(">=")) { c = factory.comparison(left, Operator.GREATER_OR_EQUAL, parseStaticOperand()); } else if (readIf("LIKE")) { c = factory.comparison(left, Operator.LIKE, parseStaticOperand()); if (supportSQL1) { if (readIf("ESCAPE")) { } while (readIf(",")); read(")"); c = factory.in(left, list); } else if (readIf("IS")) { boolean not = readIf("NOT"); } else { read("LIKE"); c = factory.comparison(left, Operator.LIKE, parseStaticOperand()); c = factory.not(c);
var = factory.bindVariable(name); bindVariables.put(name, var); read(")"); literal = factory.literal(value); return literal; } else { PropertyValue value = literal.getLiteralValue(); value = PropertyValues.newDate(value.getValue(Type.DATE)); literal = factory.literal(value); return literal;
private ConstraintImpl parseAnd() throws ParseException { ConstraintImpl a = parseCondition(); while (readIf("AND")) { a = factory.and(a, parseCondition()); } return a; }
private DynamicOperandImpl parseExpressionFunction(String functionName) throws ParseException { DynamicOperandImpl op; if ("LENGTH".equalsIgnoreCase(functionName)) { op = factory.length(parseDynamicOperand()); } else if ("NAME".equalsIgnoreCase(functionName)) { if (isToken(")")) { op = factory.nodeName(getOnlySelectorName()); } else { op = factory.nodeName(readName()); op = factory.nodeLocalName(getOnlySelectorName()); } else { op = factory.nodeLocalName(readName()); op = factory.fullTextSearchScore(getOnlySelectorName()); } else { op = factory.fullTextSearchScore(readName()); read(","); DynamicOperandImpl op2 = parseDynamicOperand(); op = factory.coalesce(op1, op2); } else if ("LOWER".equalsIgnoreCase(functionName)) { op = factory.lowerCase(parseDynamicOperand()); } else if ("UPPER".equalsIgnoreCase(functionName)) { op = factory.upperCase(parseDynamicOperand()); } else if ("PROPERTY".equalsIgnoreCase(functionName)) { PropertyValueImpl pv = parsePropertyValue(readName()); read(","); op = factory.propertyValue(pv.getSelectorName(), pv.getPropertyName(), readString().getValue(Type.STRING)); } else {
c = factory.fullTextSearch( getOnlySelectorName(), null, parseStaticOperand()); } else if (readIf(".")) { c = factory.fullTextSearch( getOnlySelectorName(), null, parseStaticOperand()); } else { if (readIf("*")) { read(","); c = factory.fullTextSearch( name, null, parseStaticOperand()); } else { name = readName(); read(","); c = factory.fullTextSearch( selector, name, parseStaticOperand()); c = factory.fullTextSearch( getOnlySelectorName(), name, parseStaticOperand()); String name = readName(); if (readIf(",")) { c = factory.sameNode(name, readAbsolutePath()); } else { c = factory.sameNode(getOnlySelectorName(), name);
String selector2 = readName(); if (readIf(",")) { c = factory.sameNodeJoinCondition(selector1, selector2, readPath()); } else { c = factory.sameNodeJoinCondition(selector1, selector2, "."); c = factory.childNodeJoinCondition(childSelector, readName()); } else if ("ISDESCENDANTNODE".equalsIgnoreCase(name)) { String descendantSelector = readName(); read(","); c = factory.descendantNodeJoinCondition(descendantSelector, readName()); } else { throw getSyntaxError("ISSAMENODE, ISCHILDNODE, or ISDESCENDANTNODE"); String selector2 = readName(); read("."); return factory.equiJoinCondition(selector1, property1, selector2, readName());
private ConstraintImpl parseCondition() throws ParseException { ConstraintImpl a; if (readIf("NOT")) { a = factory.not(parseCondition()); } else if (readIf("(")) { a = parseConstraint(); a = parseCondition(factory.propertyValue(identifier, readName())); } else { a = parseCondition(factory.propertyValue(getOnlySelectorName(), identifier)); a = parseCondition(factory.propertyValue(name, readName())); } else { a = parseCondition(factory.propertyValue(getOnlySelectorName(), name)); if (readIf("IN")) { DynamicOperandImpl right = parseDynamicOperand(); ConstraintImpl c = factory.comparison(right, Operator.EQUAL, left); return c; } else {
private ConstraintImpl parseCondition(DynamicOperandImpl left) throws ParseException { ConstraintImpl c; if (readIf("=")) { c = factory.comparison(left, Operator.EQUAL, parseStaticOperand()); } else if (readIf("<>")) { c = factory.comparison(left, Operator.NOT_EQUAL, parseStaticOperand()); } else if (readIf("<")) { c = factory.comparison(left, Operator.LESS_THAN, parseStaticOperand()); } else if (readIf(">")) { c = factory.comparison(left, Operator.GREATER_THAN, parseStaticOperand()); } else if (readIf("<=")) { c = factory.comparison(left, Operator.LESS_OR_EQUAL, parseStaticOperand()); } else if (readIf(">=")) { c = factory.comparison(left, Operator.GREATER_OR_EQUAL, parseStaticOperand()); } else if (readIf("LIKE")) { c = factory.comparison(left, Operator.LIKE, parseStaticOperand()); if (supportSQL1) { if (readIf("ESCAPE")) { } while (readIf(",")); read(")"); c = factory.in(left, list); } else if (readIf("IS")) { boolean not = readIf("NOT"); } else { read("LIKE"); c = factory.comparison(left, Operator.LIKE, parseStaticOperand()); c = factory.not(c);
var = factory.bindVariable(name); bindVariables.put(name, var); read(")"); literal = factory.literal(value); return literal; } else { PropertyValue value = literal.getLiteralValue(); value = PropertyValues.newDate(value.getValue(Type.DATE)); literal = factory.literal(value); return literal;
private ConstraintImpl parseAnd() throws ParseException { ConstraintImpl a = parseCondition(); while (readIf("AND")) { a = factory.and(a, parseCondition()); } return a; }
private DynamicOperandImpl parseExpressionFunction(String functionName) throws ParseException { DynamicOperandImpl op; if ("LENGTH".equalsIgnoreCase(functionName)) { op = factory.length(parseDynamicOperand()); } else if ("NAME".equalsIgnoreCase(functionName)) { if (isToken(")")) { op = factory.nodeName(getOnlySelectorName()); } else { op = factory.nodeName(readName()); op = factory.nodeLocalName(getOnlySelectorName()); } else { op = factory.nodeLocalName(readName()); op = factory.fullTextSearchScore(getOnlySelectorName()); } else { op = factory.fullTextSearchScore(readName()); read(","); DynamicOperandImpl op2 = parseDynamicOperand(); op = factory.coalesce(op1, op2); } else if ("LOWER".equalsIgnoreCase(functionName)) { op = factory.lowerCase(parseDynamicOperand()); } else if ("UPPER".equalsIgnoreCase(functionName)) { op = factory.upperCase(parseDynamicOperand()); } else if ("PROPERTY".equalsIgnoreCase(functionName)) { PropertyValueImpl pv = parsePropertyValue(readName()); read(","); op = factory.propertyValue(pv.getSelectorName(), pv.getPropertyName(), readString().getValue(Type.STRING)); } else {
c = factory.fullTextSearch( getOnlySelectorName(), null, parseStaticOperand()); } else if (readIf(".")) { c = factory.fullTextSearch( getOnlySelectorName(), null, parseStaticOperand()); } else { if (readIf("*")) { read(","); c = factory.fullTextSearch( name, null, parseStaticOperand()); } else { name = readName(); read(","); c = factory.fullTextSearch( selector, name, parseStaticOperand()); c = factory.fullTextSearch( getOnlySelectorName(), name, parseStaticOperand()); String name = readName(); if (readIf(",")) { c = factory.sameNode(name, readAbsolutePath()); } else { c = factory.sameNode(getOnlySelectorName(), name);
String selector2 = readName(); if (readIf(",")) { c = factory.sameNodeJoinCondition(selector1, selector2, readPath()); } else { c = factory.sameNodeJoinCondition(selector1, selector2, "."); c = factory.childNodeJoinCondition(childSelector, readName()); } else if ("ISDESCENDANTNODE".equalsIgnoreCase(name)) { String descendantSelector = readName(); read(","); c = factory.descendantNodeJoinCondition(descendantSelector, readName()); } else { throw getSyntaxError("ISSAMENODE, ISCHILDNODE, or ISDESCENDANTNODE"); String selector2 = readName(); read("."); return factory.equiJoinCondition(selector1, property1, selector2, readName());