Browse Source

Category: return only a single Category object since category is unique

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

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

@ -2,8 +2,6 @@
package com.fjordtek.bookstore.model.book;
import java.util.List;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
@ -26,9 +24,9 @@ import org.springframework.data.rest.core.annotation.RestResource;
public interface CategoryRepository extends CrudRepository<Category, Long> {
@RestResource(exported = false)
List<Category> findByName(@Param("name") String name);
Category findByName(@Param("name") String name);
@RestResource(path = "category", rel = "category")
List<Category> findByNameIgnoreCaseContaining(@Param("name") String name);
Category findByNameIgnoreCaseContaining(@Param("name") String name);
}

Loading…
Cancel
Save