/** * {@inheritDoc} * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return getOperand().hashCode(); }
/** * {@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 UpperCase(operand)); } };
/** * @see org.xcmis.search.Visitors.AbstractModelVisitor#visit(org.xcmis.search.model.operand.UpperCase) */ @Override public void visit(UpperCase 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.UpperCase) */ public void visit(UpperCase 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.isAllUpperCase(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); }
@Override protected ConstraintBuilder setConstraint(Constraint constraint) { Comparison comparison = (Comparison)constraint; return delegate.setConstraint(new Comparison(new UpperCase(comparison.getOperand1()), comparison.getOperator(), comparison.getOperand2())); } }
/** * {@inheritDoc} * @throws VisitException if exception occurs * * @see QueryObjectModelVisitor#visit(UpperCase) */ public void visit(UpperCase upperCase) throws VisitException { append("UPPER("); upperCase.getOperand().accept(this); append(')'); }
/** * {@inheritDoc} * @throws VisitException if exception occurs * * @see QueryObjectModelVisitor#visit(UpperCase) */ public void visit(UpperCase upperCase) throws VisitException { strategy.visit(upperCase); enqueue(upperCase.getOperand()); visitNext(); }