JPA does not support UNION, but if you use EclipseLink, UNION is supported in JPQL. Also the COLUMN operator can be used to access special columns like rownum.
See,
http://java-persistence-performance.blogspot.com/2012/05/jpql-vs-sql-have-both-with-eclipselink.html