【发布时间】:2021-06-17 08:16:16
【问题描述】:
我正在使用 Spring Boot 和谷歌数据存储。下面是我的主要实体,它引用了其他实体“患者”。
@Entity(name = "depart_list")
public class DepartList {
@Id private String compositeKey;
@Reference private List<Patient> patients;
}
@Entity(name = "patient")
public class Patient {
@Id private String compositeKey;
private String cid;
private LocalDate date;
jpa方法:
Page<DepartList> findByCompositeKey(String compositeKey, Pageable pageable);
现在的问题是我在数据存储中只有 1 个结果,但所引用的患者列表值超过了 1000,我不知道如何对其应用限制/页面。这就是为什么我会遇到异常。
com.google.datastore.v1.client.DatastoreException: cannot get more than 1000 keys in a single call, code=INVALID_ARGUMENT
【问题讨论】:
标签: java spring-boot spring-data-jpa google-cloud-datastore