I have to join two result sets coming from different database tables, something like:
SELECT a,b FROM abtable UNION ALL SELECT c,d FROM cdtable;
My current working solution is to have 2 queries and to join the resultlists (java.util.List) in java. But for the sake of performance and uniform coding patterns I would like to do this in JPA2 using the criteria API.
The UNION keyword doesn't seem to be supported in JPA2 Criteria API? Is there any alternative of doing this using JPA2 Criteria API?