Example #1
0
        public static string GenerateN1QlQuery(QueryModel queryModel, IMemberNameResolver memberNameResolver,
                                               IMethodCallTranslatorProvider methodCallTranslatorProvider, ITypeSerializer serializer)
        {
            var visitor = new N1QlQueryModelVisitor(memberNameResolver, methodCallTranslatorProvider, serializer);

            visitor.VisitQueryModel(queryModel);
            return(visitor.GetQuery());
        }
        protected override Expression VisitSubQuery(SubQueryExpression expression)
        {
            var modelVisitor = new N1QlQueryModelVisitor(QueryGenerationContext, true);

            modelVisitor.VisitQueryModel(expression.QueryModel);
            _expression.Append(modelVisitor.GetQuery());

            return(expression);
        }
 public static string GenerateN1QlQuery(QueryModel queryModel)
 {
     var visitor = new N1QlQueryModelVisitor();
     visitor.VisitQueryModel(queryModel);
     return visitor.GetQuery();
 }
        private void VisitUnion(SubQueryExpression source, bool distinct)
        {
            var queryModelVisitor = new N1QlQueryModelVisitor(_queryGenerationContext.CloneForUnion());

            queryModelVisitor.VisitQueryModel(source.QueryModel);
            var unionQuery = queryModelVisitor.GetQuery();

            _queryPartsAggregator.AddUnionPart((distinct ? " UNION " : " UNION ALL ") + unionQuery);
        }