Exemplo n.º 1
0
 @Override
 public long add(String name, Date creationDate, Integer placesCount) {
   LOGGER.info("Add plane {} creationDate = {} placesCount = {}", name, creationDate, placesCount);
   Plane plane = new Plane();
   plane.setName(name);
   plane.setCreationDate(creationDate);
   plane.setPlacesCount(placesCount);
   return planeDao.add(plane);
 }
Exemplo n.º 2
0
 @Override
 public void update(long id, String name, Date creationDate, Integer placesCount) {
   LOGGER.info(
       "Update plane with id{}. Set  planeName = {} creationDate = {} placesCount = {}",
       id,
       name,
       creationDate,
       placesCount);
   Plane plane = new Plane();
   plane.setId(id);
   plane.setName(name);
   plane.setCreationDate(creationDate);
   plane.setPlacesCount(placesCount);
   planeDao.update(plane);
 }
Exemplo n.º 3
0
 @Override
 public int getPlacesCount(long id) {
   Plane plane = planeDao.get(id);
   return plane.getPlacesCount();
 }