Ejemplo n.º 1
0
        public void BuildDatabaseStatement(QueryStatistics statistics)
        {
            if (statistics != null)
            {
                CurrentStatement.UseStatistics(statistics);
            }

            TopStatement.CompileStructure(new MartenExpressionParser(_session.Serializer, _session.Options));
        }
Ejemplo n.º 2
0
        public IQueryHandler <TResult> BuildHandler <TResult>()
        {
            // TODO -- expression parser should be a singleton somehow to avoid
            // the object allocations
            TopStatement.CompileStructure(new MartenExpressionParser(_session.Serializer, _session.Options));

            if (CurrentStatement.SingleValue)
            {
                return(CurrentStatement.BuildSingleResultHandler <TResult>(_session));
            }
            return(CurrentStatement.SelectClause.BuildHandler <TResult>(_session, TopStatement));
        }
Ejemplo n.º 3
0
        public void BuildDiagnosticCommand(FetchType fetchType, CommandBuilder sql)
        {
            switch (fetchType)
            {
            case FetchType.Any:
                CurrentStatement.ToAny();
                break;

            case FetchType.Count:
                CurrentStatement.ToCount <long>();
                break;

            case FetchType.FetchOne:
                CurrentStatement.Limit = 1;
                break;
            }

            TopStatement.CompileStructure(_session);

            TopStatement.Configure(sql);
        }
Ejemplo n.º 4
0
        public void BuildDiagnosticCommand(FetchType fetchType, CommandBuilder sql)
        {
            switch (fetchType)
            {
            case FetchType.Any:
                CurrentStatement.ToAny();
                break;

            case FetchType.Count:
                CurrentStatement.ToCount <long>();
                break;

            case FetchType.FetchOne:
                CurrentStatement.Limit = 1;
                break;
            }

            TopStatement.CompileStructure(new MartenExpressionParser(_session.Serializer, _session.Options));

            TopStatement.Configure(sql);
        }