Hello, maybe some Hibernate Pro can help me with a HQL query. I'm sorry if this is not the right forum.
I am developing a Forum software. In a Forum there can be many Messages (threads). A message can have multiple responses, which are also messages.
The basic structure for a Message is:
Message properties: -> Forum (forum object it belongs to) -> responseTo (is null if is first message in a Thread or points to the message it responds, conforming a thread) Date Subject Body
I'd like to get a list of threads (messages with null responseTo value) but sorted by the Date field of the last response to its thread. (A very old message having a recent response in its thread chain would be the first in the resultList)
Thanks for any help on this, Ignacio
|