/// <summary>
    /// Builds the field sub query.
    /// </summary>
    /// <param name="subQuery">The sub query.</param>
    /// <returns>The subquery.</returns>
    protected override string BuildFieldSubQuery(FieldQuery subQuery)
    {
      string matchVariant = this.GetMatchVariant(subQuery.MatchVariant);
      if (string.IsNullOrEmpty(matchVariant) && MatchVariant.Like == subQuery.MatchVariant)
      {
        return string.Format("contains(@{0}, '{1}')", subQuery.Key, subQuery.Value);
      }

      return string.Format("@{0} {2} '{1}'", subQuery.Key, subQuery.Value, matchVariant);
    }
    /// <summary>
    /// Builds the field sub query.
    /// </summary>
    /// <param name="subQuery">The sub query.</param>
    /// <returns>The subquery.</returns>
    protected override string BuildFieldSubQuery(FieldQuery subQuery)
    {
      string variant = this.GetMatchVariant(subQuery.MatchVariant);
      if (string.IsNullOrEmpty(variant) && subQuery.MatchVariant == MatchVariant.Like)
      {
        return string.Format("@{0} = '{2}{1}{2}'", subQuery.Key, this.EscapeSpecialCharacters(subQuery.Value), "%");
      }

      return string.Format("@{0} {2} '{1}'", subQuery.Key, subQuery.Value, variant);
    }
Example #3
0
 /// <summary>
 /// Appends the field.
 /// </summary>
 /// <param name="key">The attribute key.</param>
 /// <param name="value">The attribute value.</param>
 /// <param name="matchVariant">The match variant.</param>
 public void AppendField(string key, string value, MatchVariant matchVariant)
 {
   FieldQuery fldQuery = new FieldQuery(key, value, matchVariant);
   QueryNode node = new QueryNode(fldQuery);
   this.AddNode(node);
 }
Example #4
0
 /// <summary>
 /// Determines whether [contains] [the specified query].
 /// </summary>
 /// <param name="query">The query.</param>
 /// <returns>
 /// <c>true</c> if [contains] [the specified query]; otherwise, <c>false</c>.
 /// </returns>
 public bool Contains(FieldQuery query)
 {
   return this.Contains(this.FirstNode, query);
 }
Example #5
0
 /// <summary>
 /// Adds the specified field query.
 /// </summary>
 /// <param name="fieldQuery">The field query.</param>
 public void Add(FieldQuery fieldQuery)
 {
   this.AddNode(new QueryNode(fieldQuery));
 }
Example #6
0
 /// <summary>
 /// Determines whether [contains] [the specified query].
 /// </summary>
 /// <param name="query">The query.</param>
 /// <returns>
 /// <c>true</c> if [contains] [the specified query]; otherwise, <c>false</c>.
 /// </returns>
 public bool Contains(FieldQuery query)
 {
     return(this.Contains(this.FirstNode, query));
 }
Example #7
0
 /// <summary>
 /// Adds the specified field query.
 /// </summary>
 /// <param name="fieldQuery">The field query.</param>
 public void Add(FieldQuery fieldQuery)
 {
     this.AddNode(new QueryNode(fieldQuery));
 }
 /// <summary>
 /// Builds the field sub query.
 /// </summary>    
 /// <param name="subQuery">The sub query.</param>
 /// <returns>The subquery.</returns>
 protected abstract string BuildFieldSubQuery(FieldQuery subQuery);
Example #9
0
 /// <summary>
 /// Builds the field sub query.
 /// </summary>
 /// <param name="subQuery">The sub query.</param>
 /// <returns>The subquery.</returns>
 protected abstract string BuildFieldSubQuery(FieldQuery subQuery);