Пример #1
0
        protected override string getHql()
        {
            string          hql             = "select c from Comment c";
            var             conditions      = new List <string>();
            WhereHqlBuilder whereHqlBuilder = new WhereHqlBuilder(hql, conditions);

            return(whereHqlBuilder.Hql());
        }
Пример #2
0
        protected override string getHql()
        {
            string hql        = string.Format("select i from Income i ");
            var    conditions = new List <string>();

            if (_category != null)
            {
                conditions.Add("i.Category.Id = " + _category.Id);
            }
            WhereHqlBuilder whereHqlBuilder = new WhereHqlBuilder(hql, conditions);

            return(whereHqlBuilder.Hql());
        }
Пример #3
0
        protected override string getHql()
        {
            string hql        = "select o from Order o";
            var    conditions = new List <string>();

            if (_user != null)
            {
                conditions.Add(" o.User.Id = " + _user.Id);
            }
            if (status.HasValue)
            {
                conditions.Add(" o.Status = '" + Enum.GetName(typeof(OrderStatus), status) + "'");
            }
            WhereHqlBuilder whereHqlBuilder = new WhereHqlBuilder(hql, conditions);

            return(whereHqlBuilder.Hql());
        }