I am interested in using Hibernate INNER JOINS that return an entity/model result.
At Hibernate Community Documentation, they write:
Or - assuming that the class Family has an appropriate constructor - as an actual typesafe Java object:
select new Family(mother, mate, offspr) from DomesticCat as mother join mother.mate as mate left join mother.kittens as offspr
For the life of me, I have not been able to build that appropriate constructor. I want to query
Select new Participant(part, addr.adddressType)
from Participant part
INNER JOIN part.adddresses addr
Should I create a new Java class, let's say Participant_Address.java that reads like this:
Select new Participant_Address (part, addr.adddressType)
from Participant part
INNER JOIN part.adddresses addr
With constructor:
public Participant_Address(new Participant(...), String addressType)