@Entity
public class Book {
@id
private Long bookId;
private String bookName;
}
@Repository
public interface BookRepository extends JpaRepository<Book, Long> {
Book findBookByBookName(String bookName);
// или можно вернуть Optional
Optional<Book> findBookByBookName(String bookName);
}