【问题标题】:Is there any other Alternative for 'IN' and 'OR' operators in Objectify(The Cloud Datastore SDK does not currently support 'IN' filters). -javaObjectify 中的“IN”和“OR”运算符是否还有其他替代方法(Cloud Datastore SDK 目前不支持“IN”过滤器)。 -java
【发布时间】:2021-02-10 23:52:16
【问题描述】:

实体 1

@Cache
@Entity
public class EmployeeDO {
  @Id
  @Index
  private Long employeeId;

  @Index
  @Load
  private Ref<CompanyDO> companyId;
}

实体 2

@Cache
@Entity
public class CompanyDO {
  @Id
  @Index
  private Long companyId;

  @Index
  private String mailingAddress;
}

我想用 companyIds 列表过滤实体 1。

我正在使用 appengine-sdk 版本 1.9.68Objectify 版本 6.0.6。任何建议都会有帮助谢谢

【问题讨论】:

    标签: java google-app-engine google-cloud-datastore objectify


    【解决方案1】:

    旧的 appengine 数据存储 SDK 在客户端实现了 IN 过滤,所以...您基本上可以这样做。为每个 id 发出单独的查询。它不是特别有效,但从来没有 - 我认为他们曾经将 IN 子句中的条目限制为 30 个。

    【讨论】:

      猜你喜欢
      • 2019-05-27
      • 2022-06-29
      • 2011-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-08
      相关资源
      最近更新 更多