【发布时间】:2012-08-03 04:34:05
【问题描述】:
public interface AreaRepository extends JpaRepository<Area, Integer>, JpaSpecificationExecutor<Area>{
@Query("from Area where sup is null")
List<Area> findProvinces();
@Query("from Area where sup is null")
Page<Area> findProvinces(Pageable pg);
}
这是我的代码。第一种方法工作正常,但第二种方法不行。谁能告诉我如何使它正确?
【问题讨论】:
-
不,因为您必须更具体地了解“不起作用”的含义。顺便提一句。
@Repository在这种情况下已过时。 -
一个不相关的问题,如何使用颜色语法制作我的代码,我看到其他代码的颜色像红色或其他颜色,但我所有的代码都是黑色的,
标签: hql paging spring-data spring-data-jpa