I found this example in jboss's documentation.
select new Family(mother, mate, offspr)
from DomesticCat as mother
join mother.mate as mate
left join mother.kittens as offspr
Where does the Family
class come from. Do I need to import somewhere, or to use its fully qualified class name?
Family
是一个简单的POJO,具有适当的构造函数,需要声明或完全限定。
Family
must be a Java object that has an appropriate constructor. The import is optional if the object is a normal mapped entity (either using using annotations or in a hibernate mapping XML).
The import is optional, if it is found for another reason. :-)
Yes, it needs to exist. It is a class that is not an entity, you create it to handle in a intelligible way the three columns. It needs a constructor appropriate for the call.
Basically, it is like if you did:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.