예제 #1
0
  private BeerReference beerReferenceOf(BeerDataObject beer) {
    BeerReference reference = new BeerReference();
    reference.setId(String.valueOf(beer.getId()));
    reference.setLabel(beer.getLabel());

    return reference;
  }
예제 #2
0
  @Override
  public void addBeer(
      String label,
      String description,
      double grade,
      double alcohol,
      String brewery,
      String country)
      throws Exception {

    BeerDataObject beer = new BeerDataObject();
    beer.setLabel(label);
    beer.setDescription(description);
    beer.setGrade(grade);
    beer.setAlcohol(alcohol);
    beer.setBrewery(brewery);
    beer.setCountry(country);

    beerDAO.addBeer(beer);
  }