How to execute normal SQL query in Hibernate without HQL?

只愿长相守 提交于 2019-12-02 10:17:29

from below line of code you can use any Query with hibernate

its call Native SQL

session.createSQLQuery("SELECT * FROM table as a join table1 as b  on a.id = b.id ").list();

for more help go here

With JPA you can user entityManager.createNativeQuery(...) with Hibernate there's session.createSQLQuery(...)

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