Hibernate version:3.2.5
MySQL 5.0.45
Hello All,
I am trying to retrieve a list of objects and its many-to-many association in a single query. I can get the results I want with this :
Code:
select distinct(inf) from Info inf left join fetch inf.descriptors ds
But, I would really like to use the aliasToBean ResultTransformer to get the data in the format I need.
Code:
select inf.id as id, inf.owner.userName as owner, inf.platform.name as platform , inf.base.name as base, inf.site.name as site, inf.srcIncluded as srcIncluded, inf.compressed as compressed, inf.location as location, inf.hostName as hostName, ds.descriptor as descriptors from Info inf left join inf.descriptors ds
The problem is that I can't use left join fetch because I am not retrieving inf itself and this gives me a single descriptor for each bean ... so, no descriptor collection.
How can I get this as a collection for this query?
TIA