Java hql子查询具有不同的

Java hql子查询具有不同的,java,sql,hibernate,hql,seam2,Java,Sql,Hibernate,Hql,Seam2,我有两个hql查询。详情如下: String queryString = "select distinct le.id, count(cofl.id), " + "count(cofl.handOverDate), " + "count(cofl.dateCanceled), " +

我有两个hql查询。详情如下:

String queryString = "select distinct le.id, count(cofl.id), " +
                                                "count(cofl.handOverDate), " +
                                                "count(cofl.dateCanceled), " +
                                                "le.dateDeleted " +
                         "from CustomerOrderLine cofl " +
                         "right join cofl.billingEntity.legalEntity le " +
                         "group by le.id, le.dateDeleted " +
                         "order by le.id";

我想将它们组合起来以查看类似le.id、count()、count()、

有人知道如何组合这两个查询吗?(顺便说一句,我试着用它们中的任何一个作为子查询,但没有成功。)


提前感谢

您是否尝试了union操作符?是的,这就是问题所在,hql中没有union,还有其他建议吗?如果Hibernate有类似NHibernate Futures的功能,可以使用它
String queryString2 = "select distinct le.id, count(quote.id), le.dateDeleted " +
                          "from Quote as quote " +
                          "right join quote.contractingLegalEntity le " +
                          "group by le.id, le.dateDeleted " +
                          "order by le.id";