Hibernate doesn't support union ,so i would like to run sql separately. but finally how to combine those values ?
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);
}
Please advise how to execute two sql seperately and finally how to combine those values ?
See Question&Answers more detail:os