I'd like to use hibernate with annotations to run a rather complex native query and map the results to a tree of entities (a root object, with 1...n children, etc) . It looks like @SqlResultSetMapping is the direction I should go (for mapping entities to query results, instead of individual tables), but although it looks easy enough to map the columns in the result set to fields in one or more entities, I don't know how to set up the mapping between the (flattened) result set and the tree-like structure of the entities. Is this possible? I'm new to hibernate and EJB3, so if anyone can point me in the right direction, I would very much appreciate it!
Thanks,
Tim
|