Ejemplo n.º 1
0
  /**
   * Save a marital_status.
   *
   * @return the persisted entity
   */
  public Marital_status save(Marital_status marital_status) {
    log.debug("Request to save Marital_status : {}", marital_status);
    if (marital_status.getId() == null) {
      Optional<ManagedUserDTO> optional =
          userRepository
              .findOneByLogin(SecurityUtils.getCurrentUser().getUsername())
              .map(ManagedUserDTO::new);

      User user = new User();
      user.setId(optional.get().getId());
      user.setLogin(optional.get().getLogin());
      marital_status.setCreate_by(user);
      log.info("Preshow user" + user);
    }
    Marital_status result = marital_statusRepository.save(marital_status);
    return result;
  }
Ejemplo n.º 2
0
 /** delete the marital_status by id. */
 public void delete(Long id) {
   log.debug("Request to delete Marital_status : {}", id);
   marital_statusRepository.delete(id);
 }
Ejemplo n.º 3
0
 /**
  * get one marital_status by id.
  *
  * @return the entity
  */
 @Transactional(readOnly = true)
 public Marital_status findOne(Long id) {
   log.debug("Request to get Marital_status : {}", id);
   Marital_status marital_status = marital_statusRepository.findOne(id);
   return marital_status;
 }
Ejemplo n.º 4
0
 /**
  * get all the marital_statuss.
  *
  * @return the list of entities
  */
 @Transactional(readOnly = true)
 public Page<Marital_status> findAll(Pageable pageable) {
   log.debug("Request to get all Marital_statuss");
   Page<Marital_status> result = marital_statusRepository.findAll(pageable);
   return result;
 }