具有层次关系的实体 SQL 查询

发布于 2024-09-16 08:37:26 字数 399 浏览 3 评论 0原文

我想使用 Entity SQL 查询实体模型中某些子类型的元素。例如...

SELECT VALUE c FROM Persons AS c
WHERE c is of (Customer)

同时没问题,但如果我尝试以下查询,其中 Active 是 Customer 实体的属性...

SELECT VALUE c FROM Persons AS c
WHERE c is of (Customer) AND c.Active == true

我收到一条错误,指出“'Active' 不是当前加载的架构中“Person”类型的成员。

上面的查询中缺少什么?到底有可能吗?

I want to use Entity SQL to query the elements of some subtype in my Entity Model. For instance...

SELECT VALUE c FROM Persons AS c
WHERE c is of (Customer)

no problem meanwhile, but if I try the following query where Active is a property of Customer entity...

SELECT VALUE c FROM Persons AS c
WHERE c is of (Customer) AND c.Active == true

I got an error that state "'Active' is not a member of type 'Person' in the currently loaded schemas."

What I'm missing from the above query? It is possible after all?

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

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

发布评论

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

评论(2

没企图 2024-09-23 08:37:26

我不确定,但也许你应该用 = 替换 ==

由于他在抱怨属性名称,目前还不清楚,您是否使用复数服务,也许您必须注意“c”的含义。
这一个更有可能是原因(

I am not sure, but maybe you should replace the == with =?

It's still not clear since he's complaining on the property name, do you use a pluralization service, maybe you have to take care on the meaning of 'c'.
This one is more likely the cause (See here).

挽心 2024-09-23 08:37:26

我使用以下查询解决了该问题:

SELECT VALUE c FROM OFTYPE (Persons, Customer) AS c
WHERE c.Active == true

I resolved the problem using the following query:

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