Beispiel #1
0
        public virtual IList ExecuteHql(string query, IList parameters, int maxResults)
        {
            IQuery q = nHibernateUtil.GetSession.CreateQuery(query);
            HqlObject hql = null;

            hql = new HqlObject(query);
            if (parameters != null)
            {
                foreach (QueryParameter p in parameters)
                {
                    hql.AddParameter(p);
                }
            }
            return hql.ListMaxResults(maxResults);
        }
Beispiel #2
0
 /// <summary>
 /// sterge toate obiectele returnate de query
 /// </summary>
 /// <param name="query"></param>
 /// <param name="parameters"></param>
 /// <returns></returns>
 public virtual int DeleteHql(string query, IList parameters)
 {
     HqlObject hql = null;
     hql = new HqlObject(query);
     if (parameters != null)
     {
         foreach (QueryParameter p in parameters)
         {
             hql.AddParameter(p);
         }
     }
     return hql.Delete();
 }