标签:hibernate
如果返回一个集合就用
List<T> list = (List<T>) this.getHibernateTemplate().execute(new HibernateCallback() {
public Object doInHibernate(Session session) {
StringBuilder hql = new StringBuilder();
hql.append(sql);
org.hibernate.Query query = session.createQuery(hql
.toString());
return query.list();
}
});
标签:hibernate
原文地址:http://blog.csdn.net/menghuannvxia/article/details/39208153