Пример #1
0
        protected void AppendPropertyCondition(
            String propertyName,
            object propertyValue,
            System.Type persistentClass,
            String alias,
            IDictionary aliasClasses,
            ISessionFactoryImplementor sessionFactory,
            SqlStringBuilder builder)
        {
            if (builder.Count > 1)
            {
                builder.Add(" and ");
            }

            ICriterion crit;

            if (propertyValue != null)
            {
                bool isString = propertyValue is String;
                crit = (_isLikeEnabled && isString) ?
                       (ICriterion) new LikeExpression(propertyName, propertyValue, _isIgnoreCaseEnabled) :
                       (ICriterion) new EqExpression(propertyName, propertyValue, _isIgnoreCaseEnabled && isString);
            }
            else
            {
                crit = new NullExpression(propertyName);
            }
            builder.Add(crit.ToSqlString(sessionFactory, persistentClass, alias, aliasClasses));
        }
Пример #2
0
		protected void AppendPropertyCondition(
			String propertyName,
			object propertyValue,
			System.Type persistentClass,
			String alias,
			IDictionary aliasClasses,
			ISessionFactoryImplementor sessionFactory,
			SqlStringBuilder builder)
		{
			if( builder.Count > 1 )
			{
				builder.Add( " and " );
			}

			ICriterion crit;
			if( propertyValue != null )
			{
				bool isString = propertyValue is String;
				crit = ( _isLikeEnabled && isString ) ?
					(ICriterion)new LikeExpression( propertyName, propertyValue, _isIgnoreCaseEnabled ) :
					(ICriterion)new EqExpression( propertyName, propertyValue, _isIgnoreCaseEnabled && isString );

			}
			else
			{
				crit = new NullExpression( propertyName );
			}
			builder.Add( crit.ToSqlString( sessionFactory, persistentClass, alias, aliasClasses ) );
		}
Пример #3
0
		protected void AppendPropertyCondition(
			String propertyName,
			object propertyValue,
			ICriteria criteria,
			ICriteriaQuery cq,
			IDictionary enabledFilters,
			SqlStringBuilder builder)
		{
			if (builder.Count > 1)
			{
				builder.Add(" and ");
			}

			ICriterion crit;
			if (propertyValue != null)
			{
				bool isString = propertyValue is String;
				crit = (_isLikeEnabled && isString) ?
				       (ICriterion) new LikeExpression(propertyName, propertyValue, _isIgnoreCaseEnabled) :
				       new EqExpression(propertyName, propertyValue, _isIgnoreCaseEnabled && isString);
			}
			else
			{
				crit = new NullExpression(propertyName);
			}
			builder.Add(crit.ToSqlString(criteria, cq, enabledFilters));
		}