Pandurang Mukhekar
Pandurang Mukhekar

Reputation: 21

Why Hibernate doesn't support UNION?

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

Answers (1)

Vlad Mihalcea
Vlad Mihalcea

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

Related Questions