No, this is not possible with JPQL, because it does not have UNION (ALL). Additionally there is no way to limit amount of rows returned in query string itself with rownum, but that is done via setMaxResults.
In many situations
- executing two queries,
- limiting number of results in first one with setMaxResults, and
- discarding duplicates and combining results of both queries in Java
is viable solution.