Пример #1
0
        public string CreateSqlString(CommandFactory factory, CreateSqlState state)
        {
            StringBuilder sb        = new StringBuilder();
            CommandData   command   = factory.CreateSelectCommand(_model.EntityMapping, _model.CreateSelector(), _query, _order, _distinct, null, state);
            string        aliasName = _aliasTableName;// ?? factory.CreateDataTableMappingSql(_model.EntityMapping, state);

            sb.Append(factory.CreateAliasQuerySql(command.CommandText, aliasName));
            return(sb.ToString());
        }
Пример #2
0
        public string CreateSqlString(CommandFactory factory, CreateSqlState state)
        {
            var sb        = new StringBuilder();
            var command   = factory.CreateSelectCommand(Model.EntityMapping, Model.CreateSelector(), Query, Order, Distinct, null, state);
            var aliasName = AliasTableName;// ?? factory.CreateDataTableMappingSql(_model.EntityMapping, state);

            sb.Append(factory.CreateAliasQuerySql(command.CommandText, aliasName));
            return(sb.ToString());
        }
Пример #3
0
        public string CreateSqlString(CommandFactory factory, CreateSqlState state)
        {
            var sb = new StringBuilder();

            if (Query != null || Order != null || Distinct)
            {
                var command   = factory.CreateSelectCommand(Mapping, AllSelector.Value, Query, Order, Distinct, null, state);
                var aliasName = AliasTableName;// ?? factory.CreateDataTableMappingSql(_mapping, state);
                sb.Append(factory.CreateAliasQuerySql(command.CommandText, aliasName));
            }
            else
            {
                sb.Append(AliasTableName != null
                    ? factory.CreateAliasTableSql(factory.CreateDataTableMappingSql(Mapping, state), AliasTableName)
                    : factory.CreateDataTableMappingSql(Mapping, state));
            }
            return(sb.ToString());
        }
Пример #4
0
        public string CreateSqlString(CommandFactory factory, CreateSqlState state)
        {
            StringBuilder sb = new StringBuilder();

            if (_query != null || _order != null || _distinct)
            {
                CommandData command   = factory.CreateSelectCommand(_mapping, AllSelector.Value, _query, _order, _distinct, null, state);
                string      aliasName = _aliasTableName;// ?? factory.CreateDataTableMappingSql(_mapping, state);
                sb.Append(factory.CreateAliasQuerySql(command.CommandText, aliasName));
            }
            else
            {
                if (_aliasTableName != null)
                {
                    sb.Append(factory.CreateAliasTableSql(factory.CreateDataTableMappingSql(_mapping, state), _aliasTableName));
                }
                else
                {
                    sb.Append(factory.CreateDataTableMappingSql(_mapping, state));
                }
            }
            return(sb.ToString());
        }