Beispiel #1
0
		public void ExecutesCustomSqlFunctionContains()
		{
         string hql = @"from Customer c where contains(c.Name, :smth)";

         HQLQueryPlan plan = new HQLStringQueryPlan(hql, false, new CollectionHelper.EmptyMapClass<string, IFilter>(), sessions);

         Assert.AreEqual(1, plan.ParameterMetadata.NamedParameterNames.Count);
         Assert.AreEqual(1, plan.QuerySpaces.Count);
         Assert.AreEqual(1, plan.SqlStrings.Length);
      }
		public IQueryPlan GetHQLQueryPlan(string queryString, bool shallow, IDictionary<string, IFilter> enabledFilters)
		{
			var key = new HQLQueryPlanKey(queryString, shallow, enabledFilters);
			var plan = (IQueryPlan)planCache[key];

			if (plan == null)
			{
				if (log.IsDebugEnabled)
				{
					log.Debug("unable to locate HQL query plan in cache; generating (" + queryString + ")");
				}
				plan = new HQLStringQueryPlan(queryString, shallow, enabledFilters, factory);
				planCache.Put(key, plan);
			}
			else
			{
				if (log.IsDebugEnabled)
				{
					log.Debug("located HQL query plan in cache (" + queryString + ")");
				}
			}

			return plan;
		}
Beispiel #3
0
        public IQueryPlan GetHQLQueryPlan(string queryString, bool shallow, IDictionary <string, IFilter> enabledFilters)
        {
            var key  = new HQLQueryPlanKey(queryString, shallow, enabledFilters);
            var plan = (IQueryPlan)planCache[key];

            if (plan == null)
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("unable to locate HQL query plan in cache; generating (" + queryString + ")");
                }
                plan = new HQLStringQueryPlan(queryString, shallow, enabledFilters, factory);
                planCache.Put(key, plan);
            }
            else
            {
                if (log.IsDebugEnabled)
                {
                    log.Debug("located HQL query plan in cache (" + queryString + ")");
                }
            }

            return(plan);
        }