NHibernate HQL是否支持UNION ALL关键字? [英] Does NHibernate HQL support the UNION ALL keyword?
问题描述
经过广泛的谷歌搜索,我仍然找不到这个问题的明确答案.我见过的一些旧文章/博客文章根本没有说.如果基础数据库支持,则有人说是.哪有到目前为止,我没有回答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.
推荐答案
NHibernate不支持联合.结果始终只有一种类型.
NHibernate does not support union. There is always one type in a result.
您可以做的是查询基类或接口. NHibernate将执行并集以从实体所映射到的所有表中获取所有值.
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.
还有union-subclass
映射策略,这也意味着存在基类或接口.
There is also the union-subclass
mapping strategy, which also implies that there is a base class or interface.
这篇关于NHibernate HQL是否支持UNION ALL关键字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!