I have a persisted object with a map field that can stores key values pairs. The value in each pair can also be another map of the same type or a list or a value. The list can also contain maps, list or other values. The list, map and value classes all share a common abstract superclass which is the class type for values in the list and map. This all provides a tree like structure for storing arbitrary meta data. I would like to order on the value of a node in the tree, e.g. a.b.c (where e.g. a is the map, b is a list and c is a value) which is present for some but not all objects of that class, but it is present for all objects in the result set (by nature of a common parent object). I currently have to read all the objects into a collection and sort the collection with a customer comparator (in Java code) but I was wondering if there was a way to do the ordering on the database?
|