/// <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);
    }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #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);
 /// <summary>
 /// Builds the field sub query.
 /// </summary>
 /// <param name="subQuery">The sub query.</param>
 /// <returns>The subquery.</returns>
 protected abstract string BuildFieldSubQuery(FieldQuery subQuery);