Hi.
I am writing a cms, which has sections and articles. Both of them are represented by the same object of the type Node of my own composition. Among other fields, a node has a Set<Node>, representing it's children. Consequently, root nodes (i.e. sections have simple keys (say, Node(1))), and articles have composite keys (say, Node(1)/Node(2)).
And for the first page of my cms i would like to have a number of articles disregard of the sections they are in. In order to do that i need to sort the articles by their keys. However, in that sorted list they appear in the wrong chronological order because of the "first part" of their keys. I.e., apparently Node(1)/Node(7) will come earlier than Node(2)/Node(3).
Is there a way to sort the entities in a query by the last part of their keys?
--
Best Regards,
Timofey Danshin.