// 获取回帖人的id
String hql = "select distinct p.userId from Post p where topicId = :topicId";
Query query = session.createQuery(hql).setInteger("topicId",
topicId);
List userIds = query.list();
// 根据id获取用户的各种信息
if (userIds != null) {
StringBuffer sbHql = new StringBuffer(
"from User u where u.id in (:ids)");
List userList = session.createQuery(sbHql.toString())
.setParameterList("ids", userIds).list();
}没有任何输出语句,执行session.createQuery(sbHql.toString()).setParameterList("ids", userIds).list();的时候居然输出值了