Session session = sessionFactory.getCurrentSession();
session.beginTransaction();
List<?> list = session
.createSQLQuery(
"SELECT a.id,a.email,b.element FROM member a,member_memberattributemapstore B WHERE a.id=b.Member_id")
.setResultTransformer(CriteriaSpecification.ALIAS_TO_ENTITY_MAP)
.list();
pager.setList(list);
System.out.println(session);
session.getTransaction().commit();
在使用hibernatesql sql查询并设置返回类型为MAP,在freemaker中可以直接遍历list,同过list.key来在页面展现