【问题标题】:Paging in Cassandra with spring-boot-data使用 spring-boot-data 在 Cassandra 中进行分页
【发布时间】:2018-05-18 19:07:53
【问题描述】:

如何使用 spring-boot-data 对检索到的行进行分页?我知道来自 Datastax 的文档:

https://docs.datastax.com/en/developer/java-driver/3.1/manual/paging/

我的仓库界面:

public interface DeviceRepository extends CassandraRepository<Device> {
    Device findByFieldDeviceId(String fieldDeviceId);
}

我的服务类:

public Device findByFieldDeviceId(final String fieldDeviceId) {
    return deviceRepository.findByFieldDeviceId(fieldDeviceId);
}

我的 Pom:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-cassandra</artifactId>
        <version>1.5.8.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-cassandra</artifactId>
        <version>1.5.8.RELEASE</version>
    </dependency>

我看不到如何从结果中提取和设置分页状态。

【问题讨论】:

    标签: java cassandra spring-data paging datastax


    【解决方案1】:

    Spring-data-cassandra 2.0 GA (Kay) 版本支持使用 Cassandra 进行分页。

    查看 PR 以获取示例代码 https://github.com/spring-projects/spring-data-cassandra/pull/114

    【讨论】:

      猜你喜欢
      • 2019-10-12
      • 2020-03-06
      • 2019-02-22
      • 2020-07-01
      • 1970-01-01
      • 2019-07-14
      • 2016-06-22
      • 2011-12-23
      • 2017-09-10
      相关资源
      最近更新 更多