How to map a native query to POJO class using jpa and hibernate

三世轮回 提交于 2019-12-09 03:58:30

With JPA you can call the constructor of your class CurrentMeasure directly inside your HQL query.

Example : SELECT NEW <package>.CurrentMeasure(obsp.Identifier, obs.phenomenontimestart, nv.value) FROM ...

The NEW syntax is explained in Jboss documentation at chapter 11.5.

Another solution would be using HQL Transformers to achieve the same result without resorting to a constructor.

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