NHibernate HQL 是否支持 UNION ALL 关键字?

发布于 2024-08-09 11:26:55 字数 110 浏览 3 评论 0原文

经过广泛的谷歌搜索后,我仍然找不到这个问题的明确答案。我看过的一些旧文章/博客文章说根本不是。有人说可以,如果底层数据库支持的话。是哪一个?我在nhusers群里询问过,目前还没有答案。任何帮助将不胜感激。

After extensive googling, I still can't find a definitive answer to this question. Some old articles/blog posts I've seen say not at all. Some say yes if the underling database supports it. Which is it? I asked on the nhusers group with no answer so far. Any help would be appreciated.

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

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

发布评论

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

评论(3

他是夢罘是命 2024-08-16 11:26:55

NHibernate 不支持联合。结果中始终只有一种类型。

您可以做的是查询基类或接口。 NHibernate 将执行联合来从实体映射到的所有表中获取所有值。

还有union-subclass映射策略,这也意味着存在基类或接口。

NHibernate does not support union. There is always one type in a result.

What you can do is a query to a base class or interface. NHibernate will perform a union to get all the values from all tables where the entities are mapped to.

There is also the union-subclass mapping strategy, which also implies that there is a base class or interface.

时光倒影 2024-08-16 11:26:55

HQL 不支持union 也不支持intersect。您可能可以通过 Criteria 或本机 SQL 来实现它。

来源:https://www.hibernate.org/117.html#A21

HQL does not support union nor intersect. You probably can achieve it via Criteria or native SQL.

Source: https://www.hibernate.org/117.html#A21

心的位置 2024-08-16 11:26:55

我在某处读到过,虽然我不明白为什么,但事实并非如此。
最好的观察方式就是亲自尝试......

I've read somewhere that it doesn't although I can't figure out why.
the best way to see is to try it your self...

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