예제 #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);
 }
예제 #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);
 }
예제 #3
0
 @Override
 public int getPlacesCount(long id) {
   Plane plane = planeDao.get(id);
   return plane.getPlacesCount();
 }