title: Hibernate - Does the resulting SQL from a HQL query get cached by the hibernate system?
body: <p>Hibernate 3.3</p>
  
  <p>If I've got code that is dynamically creating hibernate hql queries like</p>
  
  <pre><code>String query = "from Foo where ";
  if( beforeDate != null ) then query+=" createdBefore &lt; :before";
  session.createQuery(query);
  </code></pre>
  
  <p>Does the resulting sql that will get executed on the db get cached by the SessionManager so that if the same query keeps getting executed it won't have to get recompiled everytime or will it get re-parsed and rebuilt by hibernate every time?</p>
  
  <p>I'm thinking that to increase performance of my db code I'll have to write some static named queries in hibernate to reduce the parsing overhead if there is some.</p>