Exemplo n.º 1
0
  /** This is a service method to query all countries */
  @Override
  public List<Country> queryAllCountries() throws Exception {

    /*	Query all countries: the query conditions is null	*/
    List<Country> countries = countryMapper.selectByExample(null);
    return countries;
  }
Exemplo n.º 2
0
  /**
   * This is a service method to test transaction
   *
   * @throws Exception
   */
  @Override
  public void insertCountryForTransactionTesting() throws Exception {

    /*	Insert a country  */
    Country country = new Country();
    country.setCountryName("Brazil");
    countryMapper.insert(country);

    /*	Throw an exception	*/
    throw new RuntimeException();
  }