Reputation: 21
What is reason for hibernate not supporting UNION Operation ?
(SELECT a FROM t1 WHERE a=10 AND B=1 ORDER BY a LIMIT 10) UNION (SELECT a FROM t2 WHERE a=11 AND B=2 ORDER BY a LIMIT 10);
Upvotes: 2
Views: 1198
Reputation: 154020
Neither JPA nor Hibernate support it. But you can always use a native SQL query for this purpose and map the ResulSet
to entities if that's what you want.
Upvotes: 1