Ejemplo n.º 1
0
        public virtual IList ExecuteHql(string query, IList parameters, int maxResults)
        {
            IQuery q = nHibernateUtilMaster.GetSession.CreateQuery(query);
            HqlObjectMaster hql = null;

            hql = new HqlObjectMaster(query);
            if (parameters != null)
            {
                foreach (QueryParameter p in parameters)
                {
                    hql.AddParameter(p);
                }
            }
            return hql.ListMaxResults(maxResults);
        }
Ejemplo n.º 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)
 {
     HqlObjectMaster hql = null;
     hql = new HqlObjectMaster(query);
     if (parameters != null)
     {
         foreach (QueryParameter p in parameters)
         {
             hql.AddParameter(p);
         }
     }
     return hql.Delete();
 }