I know can't use Criteria query with UNION but is there any way in Hibernate or JPA?
-
18-10-2022 - |
Question
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.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow