Hello all,
Let me explain the situation:
We have an interface or abstract super class X
with several implementors A, B, C and so on...
When I get all Object of type X like this:
Query q = session.createQuery("from X x ");
I want to sort them by their classes.
For example: objects of type C before A before B
C
C
A
A
B
B
What would be the best approach to do it.
I already thought about sorting by discriminator value
or additional UserType attribute. But I am not really sure
what would be a better way.
Thank you in advance.
|