title: Hibernate criteria + calculation in Projection List
body: <h2>Invoice</h2>
  
  <p><kbd>id</kbd><kbd>description</kbd><kbd>rate</kbd><kbd>amount</kbd><br/>
  <kbd>1</kbd><kbd>Invoice A&nbsp;&nbsp;&nbsp;&nbsp;</kbd><kbd>3.0&nbsp;</kbd><kbd>10.0&nbsp;&nbsp;&nbsp;&nbsp;</kbd><br/>
  <kbd>2</kbd><kbd>Invoice B&nbsp;&nbsp;&nbsp;&nbsp;</kbd><kbd>4.0&nbsp;</kbd><kbd>20.0&nbsp;&nbsp;&nbsp;&nbsp;</kbd><br/>
  <kbd>3</kbd><kbd>Invoice C&nbsp;&nbsp;&nbsp;&nbsp;</kbd><kbd>5.0&nbsp;</kbd><kbd>30.0&nbsp;&nbsp;&nbsp;&nbsp;</kbd><br/></p>
  
  <pre><code>DetachedCriteria criteria= DetachedCriteria.forClass(Invoice.class)
  
  ProjectionList projList = new ProjectionList(); 
  projList.add(...);
  
  criteria.setProjection(projList);
  
  List list = myDAO.findByCriteria(criteria); 
  
  //260
  </code></pre>
  
  <p>Using projection list, is it possible to calculate (amount * rate) and return the sum for all records?</p>
  
  <p>Update 1:</p>
  
  <pre><code>   double dblAmount = 0.0;
     for(Invoice invoice : list){
       dblAmount = dblAmount + (invoice.getRate() * invoice.getAmount());
     }
  </code></pre>
  
  <p>Using Hibernate 4, I heard that without specifying joins, using this way (invoice.getSomething()) has performance impact?</p>