How to execute normal SQL query in Hibernate without HQL?

后端 未结 2 628
离开以前
离开以前 2021-01-25 23:00

I have a pretty complex Join query to select few items from DB, and it doesn\'t involve any Update required back to this table. Which is why, I don\'t want to use the HQL (Hiber

2条回答
  •  广开言路
    2021-01-25 23:45

    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

提交回复
热议问题