Esempio n. 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);
        }
Esempio n. 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;
		}
Esempio n. 3
0
            public bool Equals(FilterQueryPlanKey that)
            {
                if (that == null)
                {
                    return(false);
                }
                if (shallow != that.shallow)
                {
                    return(false);
                }
                if (!filterNames.SetEquals(that.filterNames))
                {
                    return(false);
                }
                if (!query.Equals(that.query))
                {
                    return(false);
                }
                if (!collectionRole.Equals(that.collectionRole))
                {
                    return(false);
                }

                return(true);
            }
Esempio n. 4
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);
        }
Esempio n. 5
0
			public bool Equals(FilterQueryPlanKey that)
			{
				if (that == null)
				{
					return false;
				}
				if (shallow != that.shallow)
				{
					return false;
				}
				if (!filterNames.SetEquals(that.filterNames))
				{
					return false;
				}
				if (!query.Equals(that.query))
				{
					return false;
				}
				if (!collectionRole.Equals(that.collectionRole))
				{
					return false;
				}

				return true;
			}