package org.synyx.urlaubsverwaltung.person.masterdata;

import org.springframework.stereotype.Service;

import java.util.Optional;

import static org.synyx.urlaubsverwaltung.person.masterdata.PersonBasedataMapper.mapFromEntity;
import static org.synyx.urlaubsverwaltung.person.masterdata.PersonBasedataMapper.mapToEntity;

@Service
public class PersonBasedataService {

    private final PersonBasedataRepository personBasedataRepository;

    public PersonBasedataService(PersonBasedataRepository personBasedataRepository) {
        this.personBasedataRepository = personBasedataRepository;
    }

    public Optional<PersonBasedata> getBasedataByPersonId(int personId) {

        final Optional<PersonBasedataEntity> personMasterdataEntity = personBasedataRepository.findById(personId);

        if(personMasterdataEntity.isPresent()) {
            PersonBasedata personBasedata = mapFromEntity(personMasterdataEntity.get());
            return Optional.of(personBasedata);
        }

        return Optional.empty();
    }

    public void update(PersonBasedata personBasedata) {
        PersonBasedataEntity personBasedataEntity = mapToEntity(personBasedata);
        personBasedataRepository.save(personBasedataEntity);
    }
}

@@ -714,30 +714,28 @@
 tity%3E person
-Master
+Base
 dataEntity =
@@ -794,30 +794,28 @@
    if(person
-Master
+Base
 dataEntity.i
@@ -896,14 +896,12 @@
 rson
-Master
+Base
 data

Rename master… to base… dataEntity