Reproducing an example from the documentation in section 11.4, Select clause - this may help you:
Queries may return multiple objects and/or properties as an array of type Object[]
select mother, offspr, mate.name
from eg.DomesticCat as mother
inner join mother.mate as mate
left outer join mother.kittens as offspr
or as an actual typesafe Java object
select new Family(mother, mate, offspr)
from eg.DomesticCat as mother
join mother.mate as mate
left join mother.kittens as offspr
assuming that the class Family has an appropriate constructor.
|