选择具有空值的对象

发布于 2024-11-24 02:25:34 字数 185 浏览 3 评论 0原文

如何在 GQL 中仅选择具有空值的对象。我有一个对象,对于我的软件的新版本,我包含 LastUpdate 字段,并且我只想更新最旧的更新对象,但是当我使用“ ORDER BY LastUpdate ASC”进行查询时,应始终使用此查询! ,它总是只返回 LastUpdate 中具有某些值的对象。

如何在查询中包含具有空值的对象的最佳方式?

How can I select only objects with null values in GQL. I have a object that for a new version of my software I include a LastUpdate fields, and I want to update only the oldest updated object, but when I made the query using " ORDER BY LastUpdate ASC", this query should always be used!, it always return only the objects with some value in LastUpdate.

How the best way I can include in a query the objects with null value?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

俯瞰星空 2024-12-01 02:25:34

如果数据存储中的实体没有设置新属性,则无法对其进行查询

实体的属性不会有 null 值,该属性根本不存在,因此不会包含在您用来查询实体的任何索引中。查找需要更新的实体的唯一方法是映射所有实体并查找缺少值的实体。

If an entity in the datastore does not have the new attribute set, then it is impossible to query on it.

The entities will not have a null value for the property, the property simply will not exist, therfore will not be included in any indexes that you would use to query your entities. The only way to find your entities that need updating is to map over ALL entities and find the ones with missing values.

一曲琵琶半遮面シ 2024-12-01 02:25:34

您对记录创建有多少控制权?您始终可以创建一条新记录,并将 LastUpdate 字段设置为与 RecordCreated 字段相同的值。这样该字段就永远不会为空,并且始终可以查询。

缺点:您还会选取很久以前创建且此后未更新的记录。

How much control do you have over record creation? You could always create a new record with the LastUpdate field set to the same value as the RecordCreated field. That way the field would never be blank and could always be queried.

Disadvantage: you would also pick up records that were created a long time ago and not updated since.

莳間冲淡了誓言ζ 2024-12-01 02:25:34

也许使用 NVL 包装器... NVL( LastUpdate, sysdate )

maybe use an NVL wrapper ... NVL( LastUpdate, sysdate )

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文