/// <summary> /// Initializes a new instance of <see cref="DbJoinClause"/> class. /// </summary> /// <param name="kind">The operation of SQL JOIN.</param> /// <param name="left">The left operand.</param> /// <param name="right">The right operand.</param> /// <param name="on">The SQL JOIN column mappings.</param> public DbJoinClause(DbJoinKind kind, DbFromClause left, DbFromClause right, IReadOnlyList <ColumnMapping> on) { Kind = kind; Left = left; Right = right; On = on; }
private DbSelectStatement(Model model, IReadOnlyList <ColumnMapping> select, DbFromClause from, DbExpression where, IReadOnlyList <DbExpressionSort> orderBy, int offset, int fetch, bool isSimple) : base(model) { Select = select; From = from; Where = where; OrderBy = orderBy; Offset = offset; Fetch = fetch; IsSimple = isSimple && From != null && offset == -1 && fetch == -1; }
/// <summary> /// Initializes a new instance of <see cref="DbSelectStatement"/> class. /// </summary> /// <param name="model">The model of this query.</param> /// <param name="select">The column mappings of the SELECT statement.</param> /// <param name="from">The FROM clause.</param> /// <param name="where">The WHERE expression.</param> /// <param name="groupBy">The GROUP BY list.</param> /// <param name="having">The HAVING expression.</param> /// <param name="orderBy">The ORDER BY list.</param> /// <param name="offset">Specifies how many rows to skip within the query result.</param> /// <param name="fetch">Specifies how many rows to return in the query result.</param> public DbSelectStatement(Model model, IReadOnlyList <ColumnMapping> select, DbFromClause from, DbExpression where, IReadOnlyList <DbExpression> groupBy, DbExpression having, IReadOnlyList <DbExpressionSort> orderBy, int offset, int fetch) : this(model, select, from, where, orderBy, offset, fetch, false) { GroupBy = groupBy; Having = having; }
/// <summary> /// Initializes a new instance of <see cref="DbSelectStatement"/> class. /// </summary> /// <param name="model">The model of this query.</param> /// <param name="select">The column mappings of the SELECT statement.</param> /// <param name="from">The FROM clause.</param> /// <param name="where">The WHERE expression.</param> /// <param name="orderBy">The ORDER BY list.</param> /// <param name="offset">Specifies how many rows to skip within the query result.</param> /// <param name="fetch">Specifies how many rows to return in the query result.</param> public DbSelectStatement(Model model, IReadOnlyList <ColumnMapping> select, DbFromClause from, DbExpression where, IReadOnlyList <DbExpressionSort> orderBy, int offset, int fetch) : this(model, select, from, where, orderBy, offset, fetch, true) { }