Ejemplo n.º 1
0
        public List <EmployeeHolidaysInfo> GetEntities(long[] emplids, int year)
        {
            if (emplids == null || emplids.Length == 0)
            {
                return(null);
            }

            List <EmployeeHolidaysInfo> entities =
                GetTypedListFromIList(
                    (IList)HibernateTemplate.Execute(
                        delegate(ISession session)
            {
                //ICriteria criteria = session.CreateCriteria(typeof(EmployeeHolidaysInfo));

                //return criteria.Add(Expression.Eq("Year", (short)year))
                //.Add(Expression.In("EmployeeID", emplids))
                //.List();

                string hql = String.Format("select info from EmployeeHolidaysInfo info where info.EmployeeID IN {0} AND info.Year=(1)", QueryUtils.GetINString(emplids), year);
                return(session.CreateQuery(hql)
                       .List());
            }
                        )
                    );

            return(entities);
        }