main
Last change
on this file since 2a5d6a3 was 2a5d6a3, checked in by Petar Partaloski <ppartaloski@…>, 2 years ago |
Controller, Repository and Service layer improvements, Entity updating
|
-
Property mode
set to
100644
|
File size:
791 bytes
|
Rev | Line | |
---|
[6e7b472] | 1 | package com.wediscussmovies.project.repository;
|
---|
| 2 |
|
---|
| 3 | import com.wediscussmovies.project.model.Person;
|
---|
[7a0bf79] | 4 | import com.wediscussmovies.project.model.PersonType;
|
---|
[6e7b472] | 5 | import org.springframework.data.jpa.repository.JpaRepository;
|
---|
[7a0bf79] | 6 | import org.springframework.data.jpa.repository.Query;
|
---|
[6e7b472] | 7 | import org.springframework.stereotype.Repository;
|
---|
| 8 |
|
---|
[7a0bf79] | 9 | import java.util.List;
|
---|
| 10 | import java.util.Optional;
|
---|
| 11 |
|
---|
[6e7b472] | 12 | @Repository
|
---|
| 13 | public interface PersonRepository extends JpaRepository<Person, Integer> {
|
---|
[7a0bf79] | 14 | public List<Person> findAllByPersonType(PersonType type);
|
---|
[2a5d6a3] | 15 | public List<Person> findAllByPersonTypeAndNameLike(PersonType type, String name);
|
---|
| 16 | public List<Person> findAllByPersonTypeAndSurnameLike(PersonType type, String surname);
|
---|
[7a0bf79] | 17 | public Optional<Person> findPersonByPerson_idAndPersonType(Integer id, PersonType type);
|
---|
[6e7b472] | 18 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.