【发布时间】:2014-02-21 18:50:01
【问题描述】:
我在 GemFire 区域中填充了数百万个对象。我不希望执行默认的findAll() SDR 查询以一次性检索数百万个对象。我试图弄清楚是否有办法覆盖默认的 findAll 查询并提供 LIMIT 参数来限制从 GemFire 区域检索到的对象数量。这是我想做的一个例子:
NoRepositoryBean
public interface CrudRepository<T, ID extends Serializable> extends Repository<T, ID> {
/**
* Returns all instances of the type.
*
* @return all entities
*/
Iterable<T> findAll();
}
public interface MyRepository extends CrudRepository<MyRepoObject, String> {
@Query("SELECT * FROM MyRegion LIMIT $1")
Iterable<CellTower> findAll(@Param("limit") String limit);
}
目前,我使用的是 Spring Data Gemfire 1.4.0.BUILD-SNAPSHOT 和 Spring Data REST 2.0.0.BUILD-SNAPSHOT 版本
【问题讨论】:
标签: spring-data spring-data-rest spring-data-gemfire