摘要:
hql中不支持union和unionAll关键字因为在查询出的结果集中无法进行排序。代替union起到相同作用的 是or关键字。在构造hql时考虑使用or代替union产生多个结果集的组合。详解如下(转载):经过百度,google知道hibernate中hql是不支持union的,所以只能借助native sql了。背景如下:一年前写了一个hql:原来代码StringcountHql2="selectcount(distinctp)fromProjectasp,CommentSimpleasc,ProjectBookmarkasbwhere("+"c.owner. 阅读全文