/** * {@inheritDoc} * * @see org.modeshape.graph.query.QueryBuilder.SingleOrderByOperandBuilder#addOrdering(org.modeshape.graph.query.model.DynamicOperand) */ @Override protected OrderByBuilder addOrdering(DynamicOperand operand) { return super.addOrdering(new LowerCase(operand)); } };
/** * @see org.xcmis.search.Visitors.AbstractModelVisitor#visit(org.xcmis.search.model.operand.LowerCase) */ @Override public void visit(LowerCase node) throws VisitException { checkSelectorExistance(node.getSelectorName()); }
/** * Get the selector symbol upon which this operand applies. * * @return the one selector names used by this operand; never null */ public SelectorName getSelectorName() { return getSelectorNames().iterator().next(); }
/** * @see org.xcmis.search.QueryObjectModelVisitor#visit(org.xcmis.search.model.operand.LowerCase) */ public void visit(LowerCase node) throws VisitException { Validate.isTrue(queryBuilderStack.peek() instanceof Boolean, "Stack should contains caseInsensitiveSearch flag"); boolean caseInsensitiveSearch = (Boolean)queryBuilderStack.pop(); final String value = (String)queryBuilderStack.peek(); if (!caseInsensitiveSearch && !StringUtils.isAllLowerCase(value)) { // search nothing because static value in different case queryBuilderStack.push(new BooleanQuery()); } queryBuilderStack.push(new Boolean(true)); // push dynamic query to stack; Visitors.visit(node.getOperand(), this); }
/** * {@inheritDoc} * @throws VisitException if exception occurs * * @see QueryObjectModelVisitor#visit(LowerCase) */ public void visit(LowerCase lowerCase) throws VisitException { append("LOWER("); lowerCase.getOperand().accept(this); append(')'); }
/** * {@inheritDoc} * @throws VisitException if exception occurs * * @see QueryObjectModelVisitor#visit(LowerCase) */ public void visit(LowerCase lowerCase) throws VisitException { strategy.visit(lowerCase); enqueue(lowerCase.getOperand()); visitNext(); }
@Override protected ConstraintBuilder setConstraint(Constraint constraint) { Comparison comparison = (Comparison)constraint; return delegate.setConstraint(new Comparison(new LowerCase(comparison.getOperand1()), comparison.getOperator(), comparison.getOperand2())); } }