title: SpringMvc Annotations for DAO interface and DAO implementation
body: <p>I would like to know if I am annotating these classes correctly, since I am new to the annotations:</p>
  
  <p><strong>Country.java</strong></p>
  
  <pre><code>@Component
  public class Country {
  
  private int countryId;
  private String countryName;
  private String countryCode;
  
  /**
   * No args constructor
   */
  public Country() {
  }
  
  /**
   * @param countryId
   * @param countryName
   * @param countryCode
   */
  public Country(int countryId, String countryName, String countryCode) {
      this.countryId = countryId;
      this.countryName = countryName;
      this.countryCode = countryCode;
  }
      //getters and setters   
  
  }
  </code></pre>
  
  <p><strong>CountryDAO.java</strong></p>
  
  <pre><code>@Repository
  public interface CountryDAO {
  
      public List&lt;Country&gt; getCountryList();
  
      public void saveCountry(Country country);
  
      public void updateCountry(Country country);
  }
  </code></pre>
  
  <p><strong>JdbcCountryDAO.java</strong></p>
  
  <pre><code>@Component
  public class JdbcCountryDAO extends JdbcDaoSupport implements CountryDAO{
  
      private final Logger logger = Logger.getLogger(getClass());
  
      @Autowired
      public List&lt;Country&gt; getCountryList() {
          int countryId = 6;
          String countryCode = "AI";
          logger.debug("In getCountryList()");
          String sql = "SELECT * FROM TBLCOUNTRY WHERE countryId = ? AND countryCode = ?";
          logger.debug("Executing getCountryList String "+sql);
  
          Object[] parameters = new Object[] {countryId, countryCode};
  
          logger.info(sql);
  
          //List&lt;Country&gt; countryList = getJdbcTemplate().query(sql,new CountryMapper());
          List&lt;Country&gt; countryList = getJdbcTemplate().query(sql, parameters,new CountryMapper());
          return countryList;
      }
  </code></pre>
  
  <p><strong>CountryManagerIFace.java</strong></p>
  
  <pre><code>@Repository
  public interface CountryManagerIFace extends Serializable{
  
      public void saveCountry(Country country);
  
      public List&lt;Country&gt; getCountries();
  }
  </code></pre>
  
  <p><strong>CountryManager.java</strong></p>
  
  <pre><code>@Component
  public class CountryManager implements CountryManagerIFace{
  
      @Autowired
      private CountryDAO countryDao;
  
      public void saveCountry(Country country) {
          countryDao.saveCountry(country);
  
      }
  
      public List&lt;Country&gt; getCountries() {
          return countryDao.getCountryList();
      }
  
  
      public void setCountryDao(CountryDAO countryDao){
  
          this.countryDao = countryDao;   
  
      }
  }
  </code></pre>