mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 06:45:49 +00:00
[feat] Change partial match
기선님 과제2: 이름 부분 검색을 지원하도록 변경
This commit is contained in:
parent
b9414e29d7
commit
52e1a9f18c
1 changed files with 1 additions and 1 deletions
|
@ -61,7 +61,7 @@ public interface OwnerRepository extends Repository<Owner, Integer> {
|
|||
*/
|
||||
void save(Owner owner);
|
||||
|
||||
@Query("SELECT DISTINCT owner FROM Owner owner left join fetch owner.pets WHERE owner.firstName LIKE :firstName%")
|
||||
@Query("SELECT DISTINCT owner FROM Owner owner left join fetch owner.pets WHERE owner.firstName LIKE %:firstName%")
|
||||
@Transactional(readOnly = true)
|
||||
Collection<Owner> findByFirstName(String firstName);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue