I was going through hibernate and situations when to use Criteria vs HQL
and my understanding is that with Hibernate, everytime when we are querying database either by Criteria
or HQL
in both instances hibernate would get result set and put in memory and then when we call that query again, data would be fetched from memory rather then hitting that database, is my understanding correct?
Also as you can see from comments to question mentioned below, it was suggested that Hibernate Criteria would get data from session and HQL would always go and hit database and so any number of multiple calls to HQL query will go and hit database and if this is the case then HQL
causes more problems than solving.
Kindly advise on this as am little bit confused with the situation.
Reference to question