コード例 #1
0
 /**
  * Save a person.
  *
  * @param personDTO the entity to save
  * @return the persisted entity
  */
 public PersonDTO save(PersonDTO personDTO) {
   log.debug("Request to save Person : {}", personDTO);
   Person person = personMapper.personDTOToPerson(personDTO);
   person = personRepository.save(person);
   PersonDTO result = personMapper.personToPersonDTO(person);
   return result;
 }
コード例 #2
0
 /**
  * Get one person by id.
  *
  * @param id the id of the entity
  * @return the entity
  */
 @Transactional(readOnly = true)
 public PersonDTO findOne(Long id) {
   log.debug("Request to get Person : {}", id);
   Person person = personRepository.findOne(id);
   PersonDTO personDTO = personMapper.personToPersonDTO(person);
   return personDTO;
 }