private PropertyExistence getPropertyExistence(PropertyValue p) throws InvalidQueryException, RepositoryException { return factory.propertyExistence(p.getSelectorName(), p.getPropertyName()); }
@Override public String apply(PropertyValue operand, Map<String, Object> variables) { return operand.getPropertyName(); } };
/** * Returns the identified property from the given row. This method * is used by both the {@link #getValue(Length, Row)} and the * {@link #getValue(PropertyValue, Row)} methods to access properties. * * @param operand property value operand * @param row row * @return the identified property, * or <code>null</code> if the property does not exist * @throws RepositoryException if the property can't be accessed */ private Property getProperty(PropertyValue operand, Row row) throws RepositoryException { return getProperty(operand, row.getNode(operand.getSelectorName())); }
/** * Returns the identified property from the given node. * * Can return <code>null</code> is the property doesn't exist or it is not * accessible. * * @param operand * @param node * @return identified property * @throws RepositoryException */ private Property getProperty(PropertyValue operand, Node node) throws RepositoryException { if (node == null) { return null; } try { return node.getProperty(operand.getPropertyName()); } catch (PathNotFoundException e) { return null; } } }
public EquiJoinMerger( Join join, Map<String, PropertyValue> columns, OperandEvaluator evaluator, QueryObjectModelFactory factory, EquiJoinCondition condition) throws RepositoryException { super(join, columns, evaluator, factory); PropertyValue property1 = factory.propertyValue( condition.getSelector1Name(), condition.getProperty1Name()); PropertyValue property2 = factory.propertyValue( condition.getSelector2Name(), condition.getProperty2Name()); if (leftSelectors.contains(property1.getSelectorName()) && rightSelectors.contains(property2.getSelectorName())) { leftProperty = property1; rightProperty = property2; } else if (leftSelectors.contains(property2.getSelectorName()) && rightSelectors.contains(property1.getSelectorName())) { leftProperty = property2; rightProperty = property1; } else { throw new RepositoryException("Invalid equi-join"); } }
private PropertyExistence getPropertyExistence(PropertyValue p) throws InvalidQueryException, RepositoryException { return factory.propertyExistence(p.getSelectorName(), p.getPropertyName()); }
/** * Returns the identified property from the given node. * * Can return <code>null</code> is the property doesn't exist or it is not * accessible. * * @param operand * @param node * @return identified property * @throws RepositoryException */ private Property getProperty(PropertyValue operand, Node node) throws RepositoryException { if (node == null) { return null; } try { return node.getProperty(operand.getPropertyName()); } catch (PathNotFoundException e) { return null; } } }
/** * Returns the identified property from the given row. This method * is used by both the {@link #getValue(Length, Row)} and the * {@link #getValue(PropertyValue, Row)} methods to access properties. * * @param operand property value operand * @param row row * @return the identified property, * or <code>null</code> if the property does not exist * @throws RepositoryException if the property can't be accessed */ private Property getProperty(PropertyValue operand, Row row) throws RepositoryException { return getProperty(operand, row.getNode(operand.getSelectorName())); }
private PropertyExistence getPropertyExistence(PropertyValue p) throws InvalidQueryException, RepositoryException { return factory.propertyExistence(p.getSelectorName(), p.getPropertyName()); }
/** * Returns the identified property from the given node. * * Can return <code>null</code> is the property doesn't exist or it is not * accessible. * * @param operand * @param node * @return identified property * @throws RepositoryException */ private Property getProperty(PropertyValue operand, Node node) throws RepositoryException { if (node == null) { return null; } try { return node.getProperty(operand.getPropertyName()); } catch (PathNotFoundException e) { return null; } } }
public EquiJoinMerger( Join join, Map<String, PropertyValue> columns, OperandEvaluator evaluator, QueryObjectModelFactory factory, EquiJoinCondition condition) throws RepositoryException { super(join, columns, evaluator, factory); PropertyValue property1 = factory.propertyValue( condition.getSelector1Name(), condition.getProperty1Name()); PropertyValue property2 = factory.propertyValue( condition.getSelector2Name(), condition.getProperty2Name()); if (leftSelectors.contains(property1.getSelectorName()) && rightSelectors.contains(property2.getSelectorName())) { leftProperty = property1; rightProperty = property2; } else if (leftSelectors.contains(property2.getSelectorName()) && rightSelectors.contains(property1.getSelectorName())) { leftProperty = property2; rightProperty = property1; } else { throw new RepositoryException("Invalid equi-join"); } }
private boolean isPrimaryTypeConstraint( DynamicOperand operand ) { if (operand instanceof PropertyValue) { PropertyValue propValue = (PropertyValue)operand; if (propValue.getSelectorName().equals(selectorName.getString())) { // The property value matches our selector name, so this might be a constraint on the // primary type or mixin types. If so, then the selector name is an alias ... String propName = propValue.getPropertyName(); return "jcr:primaryType".equals(propName) || "jcr:mixinTypes".equals(propName); } } return false; }
String propName = ((PropertyValue) operand1).getPropertyName(); dynamicOperandValues = QOMUtil.getPropertyValueFromName(propName, node); if(dynamicOperandValues == null) { scalarOperandValue = valueFactory.createValue(((BindVariableValue) operand2).getBindVariableName()); } else if (operand2 instanceof PropertyValue) { String propName = ((PropertyValue) operand2).getPropertyName(); scalarOperandValue = QOMUtil.getPropertyValueFromName(propName, node)[0];
/** * Returns the identified property from the given row. This method * is used by both the {@link #getValue(Length, Row)} and the * {@link #getValue(PropertyValue, Row)} methods to access properties. * * @param operand property value operand * @param row row * @return the identified property, * or <code>null</code> if the property does not exist * @throws RepositoryException if the property can't be accessed */ private Property getProperty(PropertyValue operand, Row row) throws RepositoryException { return getProperty(operand, row.getNode(operand.getSelectorName())); }
private boolean isPrimaryTypeConstraint( DynamicOperand operand ) { if (operand instanceof PropertyValue) { PropertyValue propValue = (PropertyValue)operand; if (propValue.getSelectorName().equals(selectorName.getString())) { // The property value matches our selector name, so this might be a constraint on the // primary type or mixin types. If so, then the selector name is an alias ... String propName = propValue.getPropertyName(); return "jcr:primaryType".equals(propName) || "jcr:mixinTypes".equals(propName); } } return false; }
} else if (operand instanceof PropertyValue) { PropertyValue value = (PropertyValue) operand; return value.getSelectorName(); } else if (operand instanceof UpperCase) { UpperCase upper = (UpperCase) operand;
private void append(PropertyValue operand) { appendName(operand.getSelectorName()); append("."); appendName(operand.getPropertyName()); }
} else if (operand instanceof PropertyValue) { PropertyValue value = (PropertyValue) operand; return value.getSelectorName(); } else if (operand instanceof UpperCase) { UpperCase upper = (UpperCase) operand;
private void append(PropertyValue operand) { appendName(operand.getSelectorName()); append("."); appendName(operand.getPropertyName()); }
/** * Test case for {@link QueryObjectModelFactory#propertyValue(String, String)} */ public void testPropertyValue() throws RepositoryException { PropertyValue propVal = qf.propertyValue(SELECTOR_NAME1, propertyName1); assertEquals("Wrong selector name", SELECTOR_NAME1, propVal.getSelectorName()); assertEquals("Wrong property name", propertyName1, propVal.getPropertyName()); }