Browse Source

Remove unnecessary 'public' access modifier

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.3-alpha
Pekka Helenius 4 years ago
parent
commit
6c5bde3516
4 changed files with 13 additions and 13 deletions
  1. +3
    -3
      bookstore/src/main/java/com/fjordtek/bookstore/model/book/AuthorRepository.java
  2. +2
    -2
      bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookHashRepository.java
  3. +6
    -6
      bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepository.java
  4. +2
    -2
      bookstore/src/main/java/com/fjordtek/bookstore/model/book/CategoryRepository.java

+ 3
- 3
bookstore/src/main/java/com/fjordtek/bookstore/model/book/AuthorRepository.java View File

@ -24,17 +24,17 @@ import org.springframework.data.rest.core.annotation.RestResource;
public interface AuthorRepository extends CrudRepository<Author,Long> { public interface AuthorRepository extends CrudRepository<Author,Long> {
@RestResource(path = "fullname", rel = "fullname") @RestResource(path = "fullname", rel = "fullname")
public List<Author> findByFirstNameIgnoreCaseContainingAndLastNameIgnoreCaseContaining(
List<Author> findByFirstNameIgnoreCaseContainingAndLastNameIgnoreCaseContaining(
@Param("firstname") String firstName, @Param("lastname") String lastName @Param("firstname") String firstName, @Param("lastname") String lastName
); );
@RestResource(path = "firstname", rel = "firstname") @RestResource(path = "firstname", rel = "firstname")
public List<Author> findByFirstNameIgnoreCaseContaining(
List<Author> findByFirstNameIgnoreCaseContaining(
@Param("firstname") String firstName @Param("firstname") String firstName
); );
@RestResource(path = "lastname", rel = "lastname") @RestResource(path = "lastname", rel = "lastname")
public List<Author> findByLastNameIgnoreCaseContaining(
List<Author> findByLastNameIgnoreCaseContaining(
@Param("lastname") String lastName @Param("lastname") String lastName
); );

+ 2
- 2
bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookHashRepository.java View File

@ -22,7 +22,7 @@ import org.springframework.data.rest.core.annotation.RepositoryRestResource;
) )
public interface BookHashRepository extends CrudRepository<BookHash, String> { public interface BookHashRepository extends CrudRepository<BookHash, String> {
public BookHash findByHashId(String bookHashId);
BookHash findByHashId(String bookHashId);
/* /*
* We need to override native delete method. * We need to override native delete method.
@ -33,6 +33,6 @@ public interface BookHashRepository extends CrudRepository<BookHash, String> {
value = "DELETE FROM BOOK_HASH i WHERE i.book_id = :bookid", value = "DELETE FROM BOOK_HASH i WHERE i.book_id = :bookid",
nativeQuery = true nativeQuery = true
) )
public void deleteByBookId(@Param("bookid") Long bookId);
void deleteByBookId(@Param("bookid") Long bookId);
} }

+ 6
- 6
bookstore/src/main/java/com/fjordtek/bookstore/model/book/BookRepository.java View File

@ -28,10 +28,10 @@ public interface BookRepository extends CrudRepository<Book, Long> {
@Override @Override
//@RestResource(exported = false) //@RestResource(exported = false)
public Optional<Book> findById(Long id);
Optional<Book> findById(Long id);
@RestResource(path = "title", rel = "title") @RestResource(path = "title", rel = "title")
public List<Book> findByTitleIgnoreCaseContaining(@Param("name") String title);
List<Book> findByTitleIgnoreCaseContaining(@Param("name") String title);
/* 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,
@ -40,13 +40,13 @@ public interface BookRepository extends CrudRepository<Book, Long> {
*/ */
//public List<Book> findByIsbn(String isbn); //public List<Book> findByIsbn(String isbn);
@RestResource(exported = false) @RestResource(exported = false)
public Book findByIsbn(String isbn);
Book findByIsbn(String isbn);
@RestResource(exported = false) @RestResource(exported = false)
public boolean existsByIsbn(String isbn);
boolean existsByIsbn(String isbn);
@Override @Override
public List<Book> findAll();
List<Book> findAll();
/* /*
* We need to override native delete method due to book hash id usage. * We need to override native delete method due to book hash id usage.
@ -58,6 +58,6 @@ public interface BookRepository extends CrudRepository<Book, Long> {
value = "DELETE FROM BOOK i WHERE i.id = :id", value = "DELETE FROM BOOK i WHERE i.id = :id",
nativeQuery = true nativeQuery = true
) )
public void deleteById(@Param("id") Long id);
void deleteById(@Param("id") Long id);
} }

+ 2
- 2
bookstore/src/main/java/com/fjordtek/bookstore/model/book/CategoryRepository.java View File

@ -24,9 +24,9 @@ import org.springframework.data.rest.core.annotation.RestResource;
public interface CategoryRepository extends CrudRepository<Category, Long> { public interface CategoryRepository extends CrudRepository<Category, Long> {
@RestResource(exported = false) @RestResource(exported = false)
public List<Category> findByName(@Param("name") String name);
List<Category> findByName(@Param("name") String name);
@RestResource(path = "category", rel = "category") @RestResource(path = "category", rel = "category")
public List<Category> findByNameIgnoreCaseContaining(@Param("name") String name);
List<Category> findByNameIgnoreCaseContaining(@Param("name") String name);
} }

Loading…
Cancel
Save