private void append(Comparison constraint) throws RepositoryException { append(constraint.getOperand1()); append(" "); appendOperator(constraint.getOperator()); append(" "); append(constraint.getOperand2()); }
if (constraint instanceof Comparison) { Comparison comparison = (Comparison)constraint; if (isPrimaryTypeConstraint(comparison.getOperand1())) { collectNodeType(comparison.getOperand2());
} else if (constraint instanceof Comparison) { Comparison c = (Comparison) constraint; return Collections.singleton(getSelectorName(c.getOperand1())); } else if (constraint instanceof SameNode) { SameNode sn = (SameNode) constraint;
if (constraint instanceof Comparison) { Comparison comparison = (Comparison)constraint; if (isPrimaryTypeConstraint(comparison.getOperand1())) { collectNodeType(comparison.getOperand2());
} else if (constraint instanceof Comparison) { Comparison c = (Comparison) constraint; return Collections.singleton(getSelectorName(c.getOperand1())); } else if (constraint instanceof SameNode) { SameNode sn = (SameNode) constraint;
private void append(Comparison constraint) throws RepositoryException { append(constraint.getOperand1()); append(" "); appendOperator(constraint.getOperator()); append(" "); append(constraint.getOperand2()); }
private void append(Comparison constraint) throws RepositoryException { append(constraint.getOperand1()); append(" "); appendOperator(constraint.getOperator()); append(" "); append(constraint.getOperand2()); }
/** * Test case for {@link QueryObjectModelFactory#comparison(DynamicOperand, String, StaticOperand)} */ public void testComparison() throws RepositoryException { PropertyValue op1 = qf.propertyValue(SELECTOR_NAME1, propertyName1); BindVariableValue op2 = qf.bindVariable(VARIABLE_NAME); for (Iterator<String> it = OPERATORS.iterator(); it.hasNext(); ) { String operator = it.next(); Comparison comp = qf.comparison(op1, operator, op2); assertTrue("Not a PropertyValue operand", comp.getOperand1() instanceof PropertyValue); assertTrue("Not a BindVariableValue operand", comp.getOperand2() instanceof BindVariableValue); assertEquals("Wrong operator", operator, comp.getOperator()); } }
Transform transform = new Transform(c.getOperand1()); DynamicOperand left = transform.operand; final String operator = c.getOperator(); StaticOperand right = c.getOperand2(); if (left instanceof Length || left instanceof FullTextSearchScore type = PropertyType.DOUBLE; final DynamicOperand operand = c.getOperand1(); final Value value = evaluator.getValue(right, type); filter = new RowPredicate() {
@Test public void comparison() throws RepositoryException { PropertyValue p = f.propertyValue("selectorName", "propertyName"); Literal l = f.literal(vf.createValue(1)); Comparison c = f.comparison(p, QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, l); assertEquals(p, c.getOperand1()); assertEquals(QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO, c.getOperator()); assertEquals(l, c.getOperand2()); assertEquals("[selectorName].[propertyName] = 1", c.toString()); }
Transform transform = new Transform(c.getOperand1()); DynamicOperand left = transform.operand; final String operator = c.getOperator(); StaticOperand right = c.getOperand2(); if (left instanceof Length || left instanceof FullTextSearchScore type = PropertyType.DOUBLE; final DynamicOperand operand = c.getOperand1(); final Value value = evaluator.getValue(right, type); filter = new RowPredicate() {
} else if (constraint instanceof Comparison) { Comparison c = (Comparison) constraint; Transform left = new Transform(c.getOperand1()); return getComparisonQuery( left.operand, left.transform, c.getOperator(), c.getOperand2(), selectorMap); } else if (constraint instanceof FullTextSearch) { return getFullTextSearchQuery((FullTextSearch) constraint);
} else if (constraint instanceof Comparison) { Comparison c = (Comparison) constraint; Transform left = new Transform(c.getOperand1()); return getComparisonQuery( left.operand, left.transform, c.getOperator(), c.getOperand2(), selectorMap); } else if (constraint instanceof FullTextSearch) { return getFullTextSearchQuery((FullTextSearch) constraint);