Return a subset of a JPA entity as a array of maps from a JPQL query?

戏子无情 提交于 2019-12-04 09:56:45

JPA provides limited amount of return types for compound selection: array, tuple and construct, while Hibernate provides much more return types for select clause, which includes Map.

SELECT NEW map(e.name, e.salary, e.department.name) FROM Employee e

This HQL query returns a Map from aliases to selected values.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!