title: I know can't use Criteria query with UNION but is there any way in Hibernate or JPA?
body: <p>I have a situation where I have to create dynamic sorting, so this purpose I am using criteria query in JPA (Using predicate and all), (I can not use NamedQuery just because if i have to provide multple ways of sorting I ahve to provide multiple comparators in Java which I do not want to prefer).
  Here I have to UNION two queries. Is there any way I could do? I know Hibernate and JPA does not support UNION.</p>