日期:2014-05-16 浏览次数:20722 次
public List findArticlesByBlogID(final long blogID, final int maxCount) { final String BY_BLOGID = "from Article where blogId = ?"; return this.getHibernateTemplate().executeFind(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException, SQLException { return session.createQuery(BY_BLOGID).setParameter(0, new Long(blogID)).setMaxResults(maxCount).list(); } }); }