@SuppressWarnings("unchecked") public ListfindByIdCard(String idcard,final int firstResult) { final String hql=" from Customer c where c.idCard='"+idcard+"' order by c.id"; System.out.println(hql); List list = hibernateTemplate.executeFind(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException, SQLException { Query query = session.createQuery(hql); query.setFirstResult(firstResult); query.setMaxResults(10); List list = query.list(); session.clear(); return list; } }); return list; }