title: To declare or not declare DataAccessException in DAO interface methods?
body: <p>I see some Spring/Hibernate code having different policies regarding declaring <code>DataAccessException</code> in DAO interface methods.</p>
  
  <p>Some do explicitly declare it and some don't (or only from time to time):</p>
  
  <pre><code>public interface FlightDao {
  
      boolean decrementSeat(Long flightId, int quantity);
  
      List&lt;Flight&gt; findFlights(String fromAirportCode, String toAirportCode) throws DataAccessException;
  
      public List&lt;Flight&gt; getFlights();
  
      Flight getFlight(Long id);
  
      Flight getFlight(String flightNumber);
  
      void save(Flight flight);
  
  }
  </code></pre>
  
  <p>What would be considered the best practice and why?</p>
  
  <p><strong>Update</strong></p>
  
  <p>From section 13.2.2 of the <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/orm.html" rel="nofollow">spring tutorial</a>, it is important to annotate the implementing DAO pojo with @Repository to make sure the underlying ORM (or JDBC) exceptions are automatically translated into the DataAccessException (runtime) exception hierarchy.</p>