/** * {@inheritDoc} * * @see org.modeshape.graph.query.QueryBuilder.OrderByOperandBuilder#length(java.lang.String, * java.lang.String) */ public OrderByBuilder length(String table, String property) { return addOrdering(new Length(new PropertyValue(selector(table), property))); }
/** * @see org.xcmis.search.Visitors.AbstractModelVisitor#visit(org.xcmis.search.model.operand.PropertyValue) */ @Override public void visit(PropertyValue node) throws VisitException { checkTableAndColumnExistance(node.getSelectorName(), node.getPropertyName(), true); }
/** * {@inheritDoc} * * @see java.lang.Object#equals(java.lang.Object) */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof Length) { Length that = (Length)obj; return this.propertyValue.equals(that.propertyValue); } return false; }
/** * @see org.xcmis.search.Visitors.AbstractModelVisitor#visit(org.xcmis.search.model.operand.PropertyValue) */ @Override public void visit(PropertyValue node) throws VisitException { //AUTO mode was removed since version 3.0. Therefore we will used STRING type as sort type. sortField = new SortField(FieldNames.createPropertyFieldName(node.getPropertyName()), SortField.STRING, order == Order.DESCENDING); }
@Override public void visit(PropertyValue prop) { symbols.add(prop.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(); }
/** * {@inheritDoc} * * @see java.lang.Object#hashCode() */ @Override public int hashCode() { return getPropertyValue().hashCode(); }
/** * {@inheritDoc} * @throws VisitException if exception occurs * * @see QueryObjectModelVisitor#visit(Length) */ public void visit(Length length) throws VisitException { append("LENGTH("); length.getPropertyValue().accept(this); append(')'); }
String propertyField = FieldNames.createFieldLengthName(node.getPropertyValue().getPropertyName()); .getPropertyName())), BooleanClause.Occur.SHOULD);
/** * {@inheritDoc} * * @see QueryObjectModelVisitor#visit(PropertyValue) */ public void visit(PropertyValue value) { append(value.getSelectorName()).append('.').append(value.getPropertyName()); }
/** * {@inheritDoc} * * @see org.modeshape.graph.query.QueryBuilder.DynamicOperandBuilder#length(java.lang.String, * java.lang.String) */ public ComparisonBuilder length(String table, String property) { return comparisonBuilder(new Length(new PropertyValue(selector(table), property))); }
Term propertyValueTerm = new Term(FieldNames.createPropertyFieldName(node.getPropertyName()), staticStingValue); TermQuery propertyValueQuery = new TermQuery(propertyValueTerm); Term maxFildValue = new Term(FieldNames.createPropertyFieldName(node.getPropertyName()), "\uFFFF"); switch (operator) notEqualQuery.add(new TermQuery(new Term(FieldNames.PROPERTIES_SET, node.getPropertyName())), BooleanClause.Occur.SHOULD); queryBuilderStack.push(new CaseInsensitiveRangeQuery(FieldNames.createPropertyFieldName(node.getPropertyName()), propertyValueTerm.text(), maxFildValue.text(), false, false)); queryBuilderStack.push(new TermRangeQuery(FieldNames.createPropertyFieldName(node.getPropertyName()), propertyValueTerm.text(), maxFildValue.text(), false, false)); queryBuilderStack.push(new CaseInsensitiveRangeQuery(FieldNames.createPropertyFieldName(node.getPropertyName()), propertyValueTerm.text(), maxFildValue.text(), true, true)); queryBuilderStack.push(new TermRangeQuery(FieldNames.createPropertyFieldName(node.getPropertyName()), propertyValueTerm.text(), maxFildValue.text(), true, true)); queryBuilderStack.push(new CaseInsensitiveRangeQuery(FieldNames.createPropertyFieldName(node.getPropertyName()), "", propertyValueTerm.text(), false, false)); queryBuilderStack.push(new TermRangeQuery(FieldNames.createPropertyFieldName(node.getPropertyName()), "", propertyValueTerm.text(), false, false)); queryBuilderStack.push(new CaseInsensitiveRangeQuery(FieldNames.createPropertyFieldName(node.getPropertyName()), "", propertyValueTerm.text(), true, true));
Table table = checkSelectorExistance(propertyValueOperand.getSelectorName()); String propertyName = propertyValueOperand.getPropertyName(); if (table != null && !propertyName.equals("*")) + " is not availeble query operator for property '" + propertyValueOperand.getPropertyName() + "' of the table '" + propertyValueOperand.getSelectorName() + "'");
/** * {@inheritDoc} * * @see org.modeshape.graph.query.QueryBuilder.DynamicOperandBuilder#propertyValue(String, * String) */ public ComparisonBuilder propertyValue(String table, String property) { return comparisonBuilder(new PropertyValue(selector(table), property)); }
/** * {@inheritDoc} * * @see org.modeshape.graph.query.QueryBuilder.OrderByOperandBuilder#propertyValue(java.lang.String, * java.lang.String) */ public OrderByBuilder propertyValue(String table, String property) { return addOrdering(new PropertyValue(selector(table), property)); }
res = new Ordering(new PropertyValue(selName, n), Order.ASCENDING); res = new Ordering(new PropertyValue(selName, n), Order.DESCENDING);
if(selName == null) throw new TreeWalkerException("There is more than one table. Use selector or table name."); res=new PropertyValue(selName,p); res=new PropertyValue(selName , p);