Reputation: 31
Recently, I need to use JPA in my project. However, I encountered some difficulties. JPA seemes to be harder than I thought. So, I post my problem here, hoping that, some guys may help me.
There are two tables operation and analysis, the sql is like the following:
select op_id from operation where flag = 1
union
select an_id from analysis where on_type = "processed";
op_id
and an_id
are two column names actually means the same.
Can anyone help me writing a JPA version of this? I'm very grateful of that. Thank you very much.
Upvotes: 1
Views: 98
Reputation: 15758
JPQL does not support unions.
You have four options:
Set
s to filter duplications)See this question here.
Upvotes: 1