Ignore:
Timestamp:
01/16/22 15:29:49 (3 years ago)
Author:
Petar Partaloski <ppartaloski@…>
Branches:
main
Children:
7bc8942
Parents:
7a0bf79
Message:

Controller, Repository and Service layer improvements, Entity updating

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/wediscussmovies/project/service/impl/PersonServiceImpl.java

    r7a0bf79 r2a5d6a3  
    2828    }
    2929
     30    @Override
     31    public Optional<Person> findById(Integer person_id) {
     32        return personRepository.findById(person_id);
     33    }
    3034
    3135    @Override
     
    3842        return personRepository.findAllByPersonType(PersonType.A);
    3943    }
     44
     45    @Override
     46    public boolean save(Person person) {
     47        Person p = personRepository.save(person);
     48        if(p != null)
     49            return true;
     50        return false;
     51    }
     52
     53    @Override
     54    public List<Person> findActorsByNameLike(String name) {
     55        return personRepository.findAllByPersonTypeAndNameLike(PersonType.A, name);
     56    }
     57
     58    @Override
     59    public List<Person> findActorsBySurnameLike(String surname) {
     60        return personRepository.findAllByPersonTypeAndSurnameLike(PersonType.A, surname);
     61    }
     62
     63    @Override
     64    public List<Person> findDirectorsByNameLike(String name) {
     65        return personRepository.findAllByPersonTypeAndNameLike(PersonType.D, name);
     66    }
     67
     68    @Override
     69    public List<Person> findDirectorsBySurnameLike(String surname) {
     70        return personRepository.findAllByPersonTypeAndSurnameLike(PersonType.D, surname);
     71    }
    4072}
Note: See TracChangeset for help on using the changeset viewer.