Spring-data-rest-jpa - >查询elementCollection

时间:2016-12-30 10:18:02

标签: java spring hibernate spring-data spring-data-jpa

我正在使用Spring,Hibernate和JPA。

我有一个像这样的书对象:

@Entity
public class Book {
    @ElementCollection(targetClass = String.class)
    private Set<String> keywords;
}

我的存储库看起来像这样:

public interface BookRepository extends PagingAndSortingRepository<Book, Long> {
    @RestResource(path = "by-keyword", rel = "by-keyword")
    List<Book> findByKeywordsContainingIgnoreCase(@Param(value = "keyword") String keyword, Pageable pageable);
}

我运行的查询总是返回0结果。

有谁知道我的错误在哪里? 我可以在没有@Query注释的情况下执行此操作吗?

0 个答案:

没有答案