top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Can we execute native sql query in hibernate?

0 votes
341 views
Can we execute native sql query in hibernate?
posted Nov 17, 2017 by Ammy Jack

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Hibernate provide option to execute native SQL queries through the use of SQLQuery object. Hibernate SQL Query is very handy when we have to execute database vendor specific queries that are not supported by hibernate API. For example query hints or the CONNECT keyword in Oracle Database.

For normal scenarios, hibernate SQL query is not the recommended approach because we loose benefits related to hibernate association and hibernate first level cache.

answer Nov 18, 2017 by Frank Lee
...