In theory, yes. You can write your own result transformer (based on org.hibernate.transform.AliasToBeanResultTransformer ), which:
- Use the
transformTuple() method to convert the 'root' bean along with one element of the collection. - Subsequently, use
transformList() to combine the elements of the collection into the appropriate parent beans.
In practice, however, it is much easier to actually match the corresponding objects, even if you intend to use them only to retrieve data from such a query.
source share