コード例 #1
0
 public static SqlQuery Create(
     SqlSelectClause selectClause,
     SqlFromClause fromClause,
     SqlWhereClause whereClause,
     SqlOrderbyClause orderbyClause,
     SqlOffsetLimitClause offsetLimitClause)
 {
     return(new SqlQuery(selectClause, fromClause, whereClause, orderbyClause, offsetLimitClause));
 }
コード例 #2
0
        public override SqlObject Visit(SqlOrderbyClause sqlOrderByClause)
        {
            SqlOrderByItem[] items = new SqlOrderByItem[sqlOrderByClause.OrderbyItems.Count];
            for (int i = 0; i < sqlOrderByClause.OrderbyItems.Count; i++)
            {
                items[i] = sqlOrderByClause.OrderbyItems[i].Accept(this) as SqlOrderByItem;
            }

            return(SqlOrderbyClause.Create(items));
        }
コード例 #3
0
 public override void Visit(SqlOrderbyClause sqlOrderByClause)
 {
     this.writer.Write("ORDER BY ");
     sqlOrderByClause.OrderbyItems[0].Accept(this);
     for (int i = 1; i < sqlOrderByClause.OrderbyItems.Count; i++)
     {
         this.writer.Write(", ");
         sqlOrderByClause.OrderbyItems[i].Accept(this);
     }
 }
コード例 #4
0
        public override int Visit(SqlOrderbyClause sqlOrderByClause)
        {
            int hashCode = SqlOrderbyClauseHashCode;

            for (int i = 0; i < sqlOrderByClause.OrderbyItems.Count; i++)
            {
                hashCode = CombineHashes(hashCode, sqlOrderByClause.OrderbyItems[i].Accept(this));
            }

            return(hashCode);
        }
コード例 #5
0
 public static SqlQuery Create(
     SqlSelectClause selectClause,
     SqlFromClause fromClause,
     SqlWhereClause whereClause,
     SqlGroupByClause groupByClause,
     SqlOrderbyClause orderByClause,
     SqlOffsetLimitClause offsetLimitClause) => new SqlQuery(
     selectClause,
     fromClause,
     whereClause,
     groupByClause,
     orderByClause,
     offsetLimitClause);
コード例 #6
0
 private SqlQuery(
     SqlSelectClause selectClause,
     SqlFromClause fromClause,
     SqlWhereClause whereClause,
     SqlGroupByClause groupByClause,
     SqlOrderbyClause orderbyClause,
     SqlOffsetLimitClause offsetLimitClause)
 {
     this.SelectClause      = selectClause ?? throw new ArgumentNullException(nameof(selectClause));
     this.FromClause        = fromClause;
     this.WhereClause       = whereClause;
     this.GroupByClause     = groupByClause;
     this.OrderbyClause     = orderbyClause;
     this.OffsetLimitClause = offsetLimitClause;
 }
コード例 #7
0
        protected SqlQuery(
            SqlSelectClause selectClause,
            SqlFromClause fromClause,
            SqlWhereClause whereClause,
            SqlOrderbyClause orderbyClause,
            SqlOffsetLimitClause offsetLimitClause)
            : base(SqlObjectKind.Query)
        {
            if (selectClause == null)
            {
                throw new ArgumentNullException($"{nameof(selectClause)} must not be null.");
            }

            this.SelectClause      = selectClause;
            this.FromClause        = fromClause;
            this.WhereClause       = whereClause;
            this.OrderbyClause     = orderbyClause;
            this.OffsetLimitClause = offsetLimitClause;
        }