Exemplo n.º 1
0
        private String GenerateSelect()
        {
            StringBuilder sbSql = StringHelper.CreateBuilder();

            if (_projection == null)
            {
                sbSql.Append(_table.ToSqlSelect(_factory.Dialect, _factory.Mapping.Catalog, _factory.Mapping.Schema, false));
            }
            else
            {
                sbSql.Append("SELECT ")
                .Append(_projection.Render(this))
                .Append(" FROM ")
                .Append(_table.GetQualifiedName(_factory.Dialect, _factory.Mapping.Catalog, _factory.Mapping.Schema));
            }

            GenerateFragment(sbSql, "WHERE", _conditions, " AND ");

            if (_projection != null && _projection.Grouped)
            {
                sbSql.Append(" GROUP BY ").Append(_projection.ToGroupString(this));
            }

            return(sbSql.ToString());
        }
Exemplo n.º 2
0
 /// <inheritdoc/>
 public String Render(ICriteria criteria)
 {
     return("distinct " + _projection.Render(criteria));
 }