// Path: hazelcast-spring-data-query/src/main/java/org/littlewings/hazelcast/spring/entity/Book.java
// @KeySpace("books")
// public class Book implements Serializable {
//     private static final long serialVersionUID = 1L;
// 
//     @Id
//     private String isbn;
//     private String title;
//     private int price;
// 
//     public static Book create(String isbn, String title, int price) {
//         Book book = new Book();
//         book.setIsbn(isbn);
//         book.setTitle(title);
//         book.setPrice(price);
// 
//         return book;
//     }
// 
//     public String getIsbn() {
//         return isbn;
//     }
// 
//     public void setIsbn(String isbn) {
//         this.isbn = isbn;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public void setTitle(String title) {
//         this.title = title;
//     }
// 
//     public int getPrice() {
//         return price;
//     }
// 
//     public void setPrice(int price) {
//         this.price = price;
//     }
// }


import java.util.List;
import org.littlewings.hazelcast.spring.entity.Book;
import org.springframework.data.hazelcast.repository.HazelcastRepository;
import org.springframework.data.hazelcast.repository.query.Query;
package org.littlewings.hazelcast.spring.repository;



public interface BookRepository extends HazelcastRepository<Book, String> {
    // Book findByTitle(String title);

    // List<Book> findByPriceGreaterThan(int price);

    @Query("title = '%s'")
    List<Book> findByTitle(String title);

    @Query("price > %d")
    List<Book> findByPriceGreaterThan(int price);

    @Query("isbn = '%s' and price > %d")
// Path: hazelcast-spring-data-query/src/main/java/org/littlewings/hazelcast/spring/entity/Book.java
// @KeySpace("books")
// public class Book implements Serializable {
//     private static final long serialVersionUID = 1L;
// 
//     @Id
//     private String isbn;
//     private String title;
//     private int price;
// 
//     public static Book create(String isbn, String title, int price) {
//         Book book = new Book();
//         book.setIsbn(isbn);
//         book.setTitle(title);
//         book.setPrice(price);
// 
//         return book;
//     }
// 
//     public String getIsbn() {
//         return isbn;
//     }
// 
//     public void setIsbn(String isbn) {
//         this.isbn = isbn;
//     }
// 
//     public String getTitle() {
//         return title;
//     }
// 
//     public void setTitle(String title) {
//         this.title = title;
//     }
// 
//     public int getPrice() {
//         return price;
//     }
// 
//     public void setPrice(int price) {
//         this.price = price;
//     }
// }


// Path: hazelcast-spring-data-query/src/main/java/org/littlewings/hazelcast/spring/repository/BookRepository.java
import java.util.List;
import org.littlewings.hazelcast.spring.entity.Book;
import org.springframework.data.hazelcast.repository.HazelcastRepository;
import org.springframework.data.hazelcast.repository.query.Query;

package org.littlewings.hazelcast.spring.repository;



public interface BookRepository extends HazelcastRepository<Book, String> {
    // Book findByTitle(String title);

    // List<Book> findByPriceGreaterThan(int price);

    @Query("title = '%s'")
    List<Book> findByTitle(String title);

    @Query("price > %d")
    List<Book> findByPriceGreaterThan(int price);

    @Query("isbn = '%s' and price > %d")
    List<Book> findByIsbnAndGreaterThanPrice(String isbn, int price);