public SearchOrder(PropertyType propertyToOrder, OrderDirection direction) { if (propertyToOrder == null) throw new ArgumentNullException("propertyToOrder"); _propertyToOrder = new PropertyLiteral(propertyToOrder); _direction = direction; }
public ReferenceExpression(ReferenceAttribute referrerProperty, Expression expression) { if (expression == null) throw new ArgumentNullException("expression"); _referrerProperty = new PropertyLiteral((NodeAttribute)referrerProperty); _expression = expression; //_existenceOnly = false; }
public ReferenceExpression(PropertyType referrerProperty) { if (referrerProperty == null) throw new ArgumentNullException("referrerProperty"); if (referrerProperty.DataType != DataType.Reference) throw new ArgumentOutOfRangeException("referrerProperty", "The DataType of 'referrerProperty' must be Reference"); _referrerProperty = new PropertyLiteral(referrerProperty); _existenceOnly = true; }
private string CompileMaxValue(PropertyLiteral literal) { //<##> //return ValueFormatter.GetMaxValue(literal.DataType); return null; //</##> }
private string CompileLeftValue(PropertyLiteral propLit) { if (propLit.IsSlot) return CompilePropertySlot(propLit.PropertySlot); else return CompileNodeAttribute(propLit.NodeAttribute); }
private Query CompileBinaryExpression(PropertyLiteral left, Operator op, Literal right) { //PropertyLiteral left = expression.BinExp.LeftValue; //Operator op = expression.BinExp.Operator; //Literal right = expression.BinExp.RightValue; if (!right.IsValue) throw new NotSupportedException(); var formatterName = left.DataType.ToString(); if (left.Name == "Path" && op == Operator.StartsWith) return CompileInTreeQuery((string)right.Value); var leftName = CompileLeftValue(left); var rightValue = CompileLiteralValue(right.Value, formatterName); Term rightTerm = CreateRightTerm(leftName, op, rightValue); Term minTerm; Term maxTerm; switch (op) { case Operator.StartsWith: // left:right* return new PrefixQuery(rightTerm); case Operator.EndsWith: // left:*right case Operator.Contains: // left:*right* return new WildcardQuery(rightTerm); case Operator.Equal: // left:right return new TermQuery(rightTerm); case Operator.NotEqual: // -(left:right) throw new NotSupportedException("##Wrong optimizer"); case Operator.LessThan: // left:{minValue TO right} minTerm = new Term(leftName, CompileMinValue(left)); return new RangeQuery(minTerm, rightTerm, false); case Operator.GreaterThan: // left:{right TO maxValue} maxTerm = new Term(leftName, CompileMaxValue(left)); return new RangeQuery(rightTerm, maxTerm, false); case Operator.LessThanOrEqual: // left:[minValue TO right] minTerm = new Term(leftName, CompileMinValue(left)); return new RangeQuery(minTerm, rightTerm, true); case Operator.GreaterThanOrEqual: // left:[right TO maxValue] maxTerm = new Term(leftName, CompileMaxValue(left)); return new RangeQuery(rightTerm, maxTerm, true); default: throw new NotImplementedException(); } }
public BinaryExpression(NodeAttribute property, Operator op, NodeAttribute value) { _leftValue = new PropertyLiteral(property); _operator = op; _rightValue = new Literal(value); }
public BinaryExpression(PropertyType property, Operator op, PropertyType value) { _leftValue = new PropertyLiteral(property); _operator = op; _rightValue = new Literal(value); }
public ReferenceExpression(ReferenceAttribute referrerProperty) { _referrerProperty = new PropertyLiteral((NodeAttribute)referrerProperty); _existenceOnly = true; }
public ReferenceExpression(ReferenceAttribute referrerProperty, Node referencedNode) { _referrerProperty = new PropertyLiteral((NodeAttribute)referrerProperty); _referencedNode = referencedNode; //_existenceOnly = false; }
internal SearchOrder(NodeAttribute propertyToOrder, OrderDirection direction) { _propertyToOrder = new PropertyLiteral(propertyToOrder); _direction = direction; }