Esempio n. 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);
 }
Esempio n. 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;
 }