Browse Source

Modify findById method

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.2-alpha
Pekka Helenius 4 years ago
parent
commit
e430378fdf
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      bookstore/src/main/java/com/fjordtek/bookstore/model/BookRepository.java

+ 3
- 2
bookstore/src/main/java/com/fjordtek/bookstore/model/BookRepository.java View File

@ -2,13 +2,14 @@
package com.fjordtek.bookstore.model; package com.fjordtek.bookstore.model;
import java.util.List;
import java.util.Optional;
import org.springframework.data.repository.CrudRepository; import org.springframework.data.repository.CrudRepository;
public interface BookRepository extends CrudRepository<Book, Long> { public interface BookRepository extends CrudRepository<Book, Long> {
public List<Book> findById(String title);
@Override
public Optional<Book> findById(Long id);
/* Assume a single book with a single ISBN, or multiple books with possibly duplicate ISBNs? /* 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, * For meanwhile, we have a UNIQUE constraint for ISBN values. If this policy changes,


Loading…
Cancel
Save