public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
		{
			return new TypedValue[]
				{
					criteriaQuery.GetTypedValue(criteria, _propertyName, _value.ToString().ToLower())
				};
		}
Example #2
0
        public static TypedValue[] GetTypedValues(ICriteriaQuery criteriaQuery, ICriteria criteria,
                                                  IProjection projection,
                                                  string propertyName,
                                                  params object[] values)
        {
            List <TypedValue> types = new List <TypedValue>();
            var propertyProjection  = projection as IPropertyProjection;

            if (projection == null || propertyProjection != null)
            {
                var pn = propertyProjection != null ? propertyProjection.PropertyName : propertyName;
                foreach (object value in values)
                {
                    TypedValue typedValue = criteriaQuery.GetTypedValue(criteria, pn, value);
                    types.Add(typedValue);
                }
            }
            else
            {
                foreach (object value in values)
                {
                    types.Add(new TypedValue(NHibernateUtil.GuessType((object)value), value, EntityMode.Poco));
                }
            }
            return(types.ToArray());
        }
Example #3
0
        public static TypedValue[] GetTypedValues(
            ICriteriaQuery criteriaQuery, ICriteria criteria,
            IProjection projection, string propertyName, params object[] values)
        {
            var types = new List <TypedValue>();

            var propertyProjection = projection as IPropertyProjection;

            if (projection == null || propertyProjection != null)
            {
                var propertyPath = propertyProjection != null ? propertyProjection.PropertyName : propertyName;
                foreach (object value in values)
                {
                    var typedValue = criteriaQuery.GetTypedValue(criteria, propertyPath, value);
                    types.Add(typedValue);
                }
            }
            else
            {
                foreach (var value in values)
                {
                    types.Add(new TypedValue(TypeUtil.GuessType(value), value));
                }
            }

            return(types.ToArray());
        }
Example #4
0
 /// <summary>
 /// Return typed values for all parameters in the rendered SQL fragment
 /// </summary>
 /// <param name="criteria"></param>
 /// <param name="criteriaQuery"></param>
 /// <returns>
 /// An array of TypedValues for the Expression.
 /// </returns>
 public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
 {
     if (this.anotherGeometry is IGeometry)
     {
         return(new TypedValue[] { criteriaQuery.GetTypedValue(criteria, propertyName, anotherGeometry) });
     }
     return(new TypedValue[0]);
 }
 /// <summary>
 /// Return typed values for all parameters in the rendered SQL fragment
 /// </summary>
 /// <param name="criteria"></param>
 /// <param name="criteriaQuery"></param>
 /// <returns>
 /// An array of TypedValues for the Expression.
 /// </returns>
 public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
 {
     if (this.anotherGeometry is IGeometry)
     {
         return new TypedValue[] { criteriaQuery.GetTypedValue(criteria, propertyName, anotherGeometry) };
     }
     return new TypedValue[0];
 }
        public TypedValue GetParameterTypedValue(ICriteria criteria, ICriteriaQuery criteriaQuery)
        {
//			object icvalue = ignoreCase ? value.ToString().ToLower() : value;
//			if (_projection != null)
//			{
//				return CriterionUtil.GetTypedValues(criteriaQuery, criteria, _projection, null, icvalue).Single();
//			}
            return(criteriaQuery.GetTypedValue(criteria, propertyName, envelope));
        }
Example #7
0
        public TypedValue GetParameterTypedValue(ICriteria criteria, ICriteriaQuery criteriaQuery)
        {
            var matchValue = _value.ToString().ToLower();

            if (_projection != null)
            {
                return(CriterionUtil.GetTypedValues(criteriaQuery, criteria, _projection, null, matchValue).Single());
            }
            return(criteriaQuery.GetTypedValue(criteria, _propertyName, matchValue));
        }
Example #8
0
        public static TypedValue GetTypedValue(
            ICriteriaQuery criteriaQuery,
            ICriteria criteria,
            IProjection projection,
            string propertyName,
            object value)
        {
            if (propertyName != null || (propertyName = (projection as IPropertyProjection)?.PropertyName) != null)
            {
                return(criteriaQuery.GetTypedValue(criteria, propertyName, value));
            }

            return(new TypedValue(NHibernateUtil.GuessType(value), value));
        }
Example #9
0
        public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
        {
            List <TypedValue> typedValues = new List <TypedValue>();

            if (projection != null)
            {
                typedValues.AddRange(projection.GetTypedValues(criteria, criteriaQuery));
                typedValues.AddRange(CriterionUtil.GetTypedValues(criteriaQuery, criteria, projection, null, value.ToString().ToLower()));
            }
            else
            {
                typedValues.Add(criteriaQuery.GetTypedValue(criteria, propertyName, value.ToString().ToLower()));
            }

            return(typedValues.ToArray());
        }
Example #10
0
        public static TypedValue[] GetTypedValues(ICriteriaQuery criteriaQuery, ICriteria criteria,
            IProjection projection,
            string propertyName,
            params object[] values)
        {
            List<TypedValue> types = new List<TypedValue>();
            if (projection == null)
            {
                foreach (object value in values)
                {
                    TypedValue typedValue = criteriaQuery.GetTypedValue(criteria, propertyName, value);
                    types.Add(typedValue);
                }
            }
            else
            {
                TypedValue[] typedValues = projection.GetTypedValues(criteria, criteriaQuery);
                types.AddRange(typedValues);
                // we add the values collection _twice_ on purpose.
                // once is for the projection types, if they exists
                // the second for the parameters of the expression itself
                // if the projection is using no types, we will try to guess
                // what we have here
                foreach (object value in values)
                {
                    if (typedValues.Length != 0)
                    {
                        types.AddRange(typedValues);
                    }
                    else
                    {
                        types.Add(new TypedValue(NHibernateUtil.GuessType((object)value), value, EntityMode.Poco));
                    }
                }

            }
            return types.ToArray();
        }
		/// <summary>
		/// Return typed values for all parameters in the rendered SQL fragment
		/// </summary>
		/// <param name="criteria"></param>
		/// <param name="criteriaQuery"></param>
		/// <returns>
		/// An array of TypedValues for the Expression.
		/// </returns>
		public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
		{
			return new TypedValue[] { criteriaQuery.GetTypedValue(criteria, this.propertyName, this.envelope ) };
		}
		public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
		{
			List<TypedValue> typedValues = new List<TypedValue>();
			
			if (projection != null)
			{
				typedValues.AddRange(projection.GetTypedValues(criteria, criteriaQuery));
				typedValues.AddRange(CriterionUtil.GetTypedValues(criteriaQuery, criteria, projection, null, value.ToString().ToLower()));
			}
			else
				typedValues.Add(criteriaQuery.GetTypedValue(criteria, propertyName, value.ToString().ToLower()));
			
			return typedValues.ToArray();
		}
		public TypedValue GetParameterTypedValue(ICriteria criteria, ICriteriaQuery criteriaQuery)
		{
			var matchValue = value.ToString().ToLower();
			if (projection != null)
			{
				return CriterionUtil.GetTypedValues(criteriaQuery, criteria, projection, null, matchValue).Single();
			}
			return criteriaQuery.GetTypedValue(criteria, propertyName, matchValue);
		}
		public static TypedValue[] GetTypedValues(ICriteriaQuery criteriaQuery, ICriteria criteria,
		                                          IProjection projection,
		                                          string propertyName,
		                                          params object[] values)
		{
			List<TypedValue> types = new List<TypedValue>();
			var propertyProjection = projection as IPropertyProjection;
			if (projection == null || propertyProjection != null)
			{
				var pn = propertyProjection != null ? propertyProjection.PropertyName : propertyName;
				foreach (object value in values)
				{
					TypedValue typedValue = criteriaQuery.GetTypedValue(criteria, pn, value); 					
					types.Add(typedValue);
				}
			}
			else
			{
				foreach (object value in values)
				{
					types.Add(new TypedValue(NHibernateUtil.GuessType((object)value), value, EntityMode.Poco));
				}
			}
			return types.ToArray();

		}
		public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
		{
			object icvalue = _ignoreCase ? _value.ToString().ToLower() : _value;
			return new TypedValue[]
				{
					criteriaQuery.GetTypedValue(criteria, _propertyName, icvalue)
				};
		}
Example #16
0
 public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
 {
     return new TypedValue[] {criteriaQuery.GetTypedValue(criteria, propertyName, ignoreCase ? value.ToLower() : value)};
 }
Example #17
0
 /// <summary>
 /// Return typed values for all parameters in the rendered SQL fragment
 /// </summary>
 /// <param name="criteria"></param>
 /// <param name="criteriaQuery"></param>
 /// <returns>
 /// An array of TypedValues for the Expression.
 /// </returns>
 public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
 {
     return(new TypedValue[] { criteriaQuery.GetTypedValue(criteria, this.propertyName, this.envelope) });
 }
		public TypedValue GetParameterTypedValue(ICriteria criteria, ICriteriaQuery criteriaQuery)
		{
			object icvalue = ignoreCase ? value.ToString().ToLower() : value;
			if (_projection != null)
			{
				return CriterionUtil.GetTypedValues(criteriaQuery, criteria, _projection, null, icvalue).Single();
			}
			return criteriaQuery.GetTypedValue(criteria, propertyName, icvalue);
		}