Basically I don't have knowledge about it, I just want to clear my doubt. That when we use sql in place hql through hibernate API, will it use 2nd level cache before making query in database.? The reason being I want to utilise my 2nd level cache as much as possible.
Asked
Active
Viewed 68 times
1 Answers
0
No, it will not, because Hibernate cannot track what you fetch in the native query.
HQL will also not utilize it before query execution, but after it, when it starts assembling the entities from the result set.

Dragan Bozanovic
- 23,102
- 5
- 43
- 110