我正在使用Spring Data JPA,当我@Query用来定义查询WITHOUT时 Pageable,它可以工作:
public interface UrnMappingRepository extends JpaRepository<UrnMapping, Long> {
@Query(value = "select * from internal_uddi where urn like %?1% or contact like %?1%",
nativeQuery = true)
List<UrnMapping> fullTextSearch(String text);
}
Run Code Online (Sandbox Code Playgroud)
但是如果我添加第二个参数Pageable,那么@Query它将不起作用,Spring将解析方法的名称,然后抛出异常 No property full found.这是一个错误吗?
public interface UrnMappingRepository extends JpaRepository<UrnMapping, Long> {
@Query(value = "select * from internal_uddi where urn like %?1% or contact like %?1%",
nativeQuery = true)
Page<UrnMapping> fullTextSearch(String text, Pageable pageable);
}
Run Code Online (Sandbox Code Playgroud)