I've been trying to perform a join query using the named query feature of hibernate 2. The problem is that I've been doing it with two aliases defined in the named query, one for each of the tables that are being joined; this works fine, the only issue is that the Collection returned contains arrays of two elements (one for each bean returned by the join).
I need to have a list of beans returned from the query, not a list of arrays of beans.
Given this I created a View class that is going to contain only the information that I need from the join, so I select the data using this bean, the problem is that when I try to run the query it throws a MappingException saying that there's "No persistor for: " my View class.
I guess that this may be caused by the lack of an hbm.xml file for this class, the problem is that this View is not going to map a specific table (actually I want it to map a part of one table and a part of other table!: a join!) ... is there a way of doing such mapping in hibernate?
|