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()
原文地址:https://www.cnblogs.com/Steven5007/p/12012657.html
时间: 2024-10-08 20:52:52