Exemplo n.º 1
0
        public virtual void Render(SqlWriter writer)
        {
            if(Precedence > Left.Precedence)
            {
                writer.Append("(");
                writer.Append(Left);
                writer.Append(")");
            }
            else
            {
                writer.Append(Left);
            }

            writer.Append(Operator);

            if (Precedence > Right.Precedence)
            {
                writer.Append("(");
                writer.Append(Right);
                writer.Append(")");
            }
            else
            {
                writer.Append(Right);
            }
        }
Exemplo n.º 2
0
 public void Render(SqlWriter writer)
 {
     var type = PropertyMap.Property.PropertyType;
     if (type == typeof(bool) && !(Parent is Relational))
     {
         writer.Append(Alias + PropertyMap.Column, SqlStrings.Equal, "1");
     }
     else
     {
         writer.Append(Alias + PropertyMap.Column);
     }
 }
Exemplo n.º 3
0
        public void Render(SqlWriter writer)
        {
            for (var i = 0; i < _entityMap.Properties.Length; i++)
            {
                if (i > 0)
                    writer.Append(",");

                writer.Append(_alias + _entityMap.Properties[i].Column);
            }

            RenderRowNumber(writer);
        }
Exemplo n.º 4
0
 public virtual void Render(SqlWriter writer)
 {
     writer.Append(Operator);
     if(Precedence > Expr.Precedence)
     {
         writer.Append("(");
         writer.Append(Expr);
         writer.Append(")");
     }
     else
     {
         writer.Append(Expr);
     }
 }
Exemplo n.º 5
0
        private void RenderRowNumber(SqlWriter writer)
        {
            if (!_showRowNumber)
                return;

            writer.Append(",", SqlStrings.ROW_NUMBER + "()", SqlStrings.Over, "(");

            if (_orderBy == null)
                writer.Append(SqlStrings.OrderBy, _alias + _entityMap.Key.Column, SqlStrings.Ascending);
            else
                writer.Append(_orderBy);

            writer.Append(")", SqlStrings.As, (BracketedName)SqlStrings.ROW_NUMBER);
        }
Exemplo n.º 6
0
        public void Render(SqlWriter writer)
        {
            for (var i = 0; i < _items.Count; i++)
            {
                var item = _items[i];

                if(i == 0)
                    writer.Append(SqlStrings.OrderBy);
                else
                    writer.Append(",");

                writer.Append(item.Alias + item.Property.Column,
                              item.Ascending ? SqlStrings.Ascending : SqlStrings.Descending);
            }
        }
Exemplo n.º 7
0
        public void Render(SqlWriter writer)
        {
            var value = (string)Context.Values[Parameter.Name].Value;

            if (PartialPrefix && !value.EndsWith("%"))
                value = value + '%';

            if (PartialPostfix && !value.StartsWith("%"))
                value = '%' + value;

            Context.Values[Parameter.Name].Value = value;

            PropertyAccess.Render(writer);
            writer.Append(SqlStrings.Like);
            Parameter.Render(writer);
        }
Exemplo n.º 8
0
 public void Render(SqlWriter writer)
 {
     writer.Append(Join, ReferenceMap.To.Table, SqlStrings.As, ToAlias, SqlStrings.NoLock);
     writer.Indent();
     writer.AppendLine(SqlStrings.On, FromAlias + ReferenceMap.Column, "=", ToAlias + ReferenceMap.To.Key.Column);
     writer.Unindent();
 }
Exemplo n.º 9
0
 public void Render(SqlWriter writer)
 {
     writer.Append(SqlStrings.Top + '(' + _valueProvider.ParamName + ')');
 }
Exemplo n.º 10
0
 public void Render(SqlWriter writer)
 {
     writer.Append(Name);
 }
Exemplo n.º 11
0
 public void Render(SqlWriter writer)
 {
     writer.Append(SqlStrings.Null);
 }