diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/AuthorRepository.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/AuthorRepository.java index 17a3af8..576843b 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/AuthorRepository.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/AuthorRepository.java @@ -23,9 +23,19 @@ import org.springframework.data.rest.core.annotation.RestResource; ) public interface AuthorRepository extends CrudRepository { - @RestResource(path = "author", rel = "author") + @RestResource(path = "fullname", rel = "fullname") public List findByFirstNameIgnoreCaseContainingAndLastNameIgnoreCaseContaining( @Param("firstname") String firstName, @Param("lastname") String lastName ); + @RestResource(path = "firstname", rel = "firstname") + public List findByFirstNameIgnoreCaseContaining( + @Param("firstname") String firstName + ); + + @RestResource(path = "lastname", rel = "lastname") + public List findByLastNameIgnoreCaseContaining( + @Param("lastname") String lastName + ); + } \ No newline at end of file diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/model/BookRepository.java b/bookstore/src/main/java/com/fjordtek/bookstore/model/BookRepository.java index f93df03..eb8f2cc 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/model/BookRepository.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/model/BookRepository.java @@ -31,7 +31,7 @@ public interface BookRepository extends CrudRepository { public Optional findById(Long id); @RestResource(path = "title", rel = "title") - public List findByTitle(@Param("name") String title); + public List findByTitleIgnoreCaseContaining(@Param("name") String title); /* Assume a single book with a single ISBN, or multiple books with possibly duplicate ISBNs? * For meanwhile, we have a UNIQUE constraint for ISBN values. If this policy changes,