Hibernate5.0 EntityManager转SqlQuery并返回Map结果集
Hibernate5.0 EntityManager转SqlQuery并返回Map结果集
Query query = entityManager.createNativeQuery("select * from message");
query.unwrap(org.hibernate.SQLQuery.class)
.setResultTransformer(Transformers.ALIAS_TO_ENTITY_MAP);
List<Map<String, Object>> list = query.getResultList()
posted on 2019-12-09 18:11 Steven5007 阅读(529) 评论(0) 编辑 收藏 举报