Exemple #1
0
        public void RenderFrom(ISqlTable table, SqlBuildArguments args)
        {
            if (table == null)
            {
                throw new ArgumentNullException("table");
            }
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }

            this.WriteFrom();
            table.Render(this, args);
            this.WriteNewLine();
        }
Exemple #2
0
        public virtual void RenderJoin(ISqlTable leftTable, SqlJoinType joinType, ISqlTable rightTable, IEnumerable <ISqlFilter> conditions, SqlBuildArguments args)
        {
            this.WriteSpace();
            this.Write(joinType.ToString().ToUpper());
            this.WriteSpace();
            this.Write("JOIN");
            this.WriteSpace();

            //TODO: This is causing joined tables to render their conditions here, which is not right.
            rightTable.Render(this, args);

            if (joinType != SqlJoinType.Cross)
            {
                this.WriteSpace();
                this.Write(SqlConstants.ON);
                this.WriteSpace();
                this.RenderAll <ISqlFilter>(conditions, args, string.Concat(SqlConstants.SPACE, ConvertSqlLogicToString(SqlLogic.And), SqlConstants.SPACE));
            }
            this.WriteNewLine();
        }