弹簧数据 jpa @query和可分页
2022-08-31 10:38:49
我正在使用Spring Data JPA,当我用来定义一个没有的查询时,它的工作原理是:@Query
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);
}
但是如果我添加第二个参数,则不会起作用,并且Spring将解析方法的名称,然后抛出异常。这是一个错误吗?Pageable
@Query
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);
}