示例#1
0
        public FilterQueryPlan GetFilterQueryPlan(string filterString, string collectionRole, bool shallow, IDictionary <string, IFilter> enabledFilters)
        {
            var key  = new FilterQueryPlanKey(filterString, collectionRole, shallow, enabledFilters);
            var plan = (FilterQueryPlan)planCache[key];

            if (plan == null)
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("unable to locate collection-filter query plan in cache; generating (" + collectionRole + " : "
                              + filterString + ")");
                }
                plan = new FilterQueryPlan(filterString.ToQueryExpression(), collectionRole, shallow, enabledFilters, factory);
                planCache.Put(key, plan);
            }
            else
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("located collection-filter query plan in cache (" + collectionRole + " : " + filterString + ")");
                }
            }

            return(plan);
        }
示例#2
0
        public FilterQueryPlan GetFilterQueryPlan(string filterString, string collectionRole, bool shallow, IDictionary<string, IFilter> enabledFilters)
        {
            FilterQueryPlanKey key = new FilterQueryPlanKey(filterString, collectionRole, shallow, enabledFilters);
            FilterQueryPlan plan = (FilterQueryPlan)planCache[key];

            if (plan == null)
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("unable to locate collection-filter query plan in cache; generating (" + collectionRole + " : " + filterString + ")");
                }
                plan = new FilterQueryPlan(filterString, collectionRole, shallow, enabledFilters, factory);
            }
            else
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("located collection-filter query plan in cache (" + collectionRole + " : " + filterString + ")");
                }
            }

            planCache.Put(key, plan);

            return plan;
        }
示例#3
0
        public IQueryExpressionPlan GetFilterQueryPlan(IQueryExpression queryExpression, string collectionRole, bool shallow, IDictionary <string, IFilter> enabledFilters)
        {
            var key  = new FilterQueryPlanKey(queryExpression.Key, collectionRole, shallow, enabledFilters);
            var plan = (QueryExpressionPlan)planCache[key];

            if (plan == null)
            {
                log.DebugFormat("unable to locate collection-filter query plan in cache; generating ({0} : {1})", collectionRole, queryExpression.Key);
                plan = new FilterQueryPlan(queryExpression, collectionRole, shallow, enabledFilters, factory);
                planCache.Put(key, plan);
            }
            else
            {
                log.DebugFormat("located collection-filter query plan in cache ({0} : {1})", collectionRole, queryExpression.Key);
                plan = CopyIfRequired(plan, queryExpression);
            }

            return(plan);
        }
示例#4
0
 protected FilterQueryPlan(FilterQueryPlan source, IQueryExpression expression)
     : base(source, expression)
 {
     CollectionRole = source.CollectionRole;
 }