예제 #1
0
 @Transactional
 @Override
 public void delete(Equipment equipment) {
   if (equipment == null || equipment.getId() == null) return;
   Equipment e = equipmentDao.findById(equipment.getId());
   equipmentDao.delete(e);
 }
예제 #2
0
 @Transactional
 @Override
 public Equipment store(Equipment e) {
   if (e == null) return null;
   Equipment entity = null;
   if (e.getId() == null) {
     // create
     entity = e;
   } else {
     // update
     entity = equipmentDao.findById(e.getId());
     BeanUtils.copyProperties(e, entity);
   }
   equipmentDao.store(entity);
   return entity;
 }