I've been trying to run the following JPQL query without success:
select rr from SomeTable rr where rr.id in (
select t1.id from SomeTable t1 where t1.neighboringTable IS NULL
select t2.id from SomeTable t2 where t2.neighboringTable.id = :param
) order by rr.name asc
I've tried several ways to get the same results, like putting the subquery in the FROM clause, always with the same "results":
[137, 137] The right parenthesis is missing from the IN expression.
[221, 223] The query contains a malformed ending.
As soon as I remove the UNION, everything works fine, so I am starting to wonder whether UNION is supported by Eclipselink 2.4.1 as part of a subquery. And if it is not, how could I get the same results by other means?