title: How to know Database hit went or not?
body: <p>I'm developing an application which maintains cache, So i want to know whether database hit went or not.How can i find. Here i am posting my code,</p>
  
  <pre><code>List&lt;Employee&gt; list=dao.getEmployee();
  
           for(Employee e:list)  {
                  System.out.println(e.getId());  
              }  
  </code></pre>
  
  <p>First <code>getEmployee()</code> method will go to db get the details of Employee and stored in to cache, from second time onwards it should take from cache itself untill and unless data changed in DB.</p>
  
  <p>So i want to find <code>getEmployee()</code> method is going to DB or it is taking from cache.</p>