Ejemplo n.º 1
0
 @Override
 public User update(User entity) {
   log.info("Updating ... {}", entity);
   UserEntity usrEntity = modelMapper.map(entity, UserEntity.class);
   userRepo.save(usrEntity);
   return modelMapper.map(usrEntity, User.class);
 }
Ejemplo n.º 2
0
 @Override
 public User create(User entity) {
   log.info("Saving... {}", entity);
   UserEntity usrEntity = modelMapper.map(entity, UserEntity.class);
   usrEntity.setCreateDate(LocalDateTime.now());
   userRepo.save(usrEntity);
   return modelMapper.map(usrEntity, User.class);
 }