public List<User> getUserById(final int userId,final int maxCount,final int firstResult) throws Exception {
  final String hql = "from User where userId=? ";
  return this.getHibernateTemplate().executeFind(new HibernateCallback() {
   public Object doInHibernate(final Session session) throws HibernateException, SQLException {
    final Query query = session.createQuery(hql);
    query.setParameter(0, userId);
    query.setMaxResults(maxCount);
    query.setFirstResult(firstResult);    
    return query.list();
   }
  });
 }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-13
  • 2022-02-15
  • 2021-10-08
  • 2021-04-16
  • 2021-10-17
  • 2022-12-23
猜你喜欢
  • 2021-12-14
  • 2022-12-23
  • 2021-06-27
  • 2021-10-14
  • 2021-06-24
  • 2022-12-23
相关资源
相似解决方案