Hibernate 不支持 union ,所以我想单独运行 sql。但最后如何结合这些价值观?
String query ="select
dp.PRODUCTFAMILY,dp.PRODUCTFAMILYDESCR
from TABEL1 dd, TABEL2 DP
where dd.id = 00002
and dd.PRODUCTFAMILY is null
union
select
dp.DIVNUMBER,dp.DIVDESCR
from TABEL1 dd, TABEL2 DP
where dd.id = 00002
and dd.PRODUCT is not null and dd.PRODUCTFAMILY is not null";
public List<PRODUCT> findmethod() {
return findAllByQuery(query);
}
请告知如何分别执行两个sql,最后如何组合这些值?