HQL new List(..) within new Object(..)
问题 I have requirement where in I would like to create a new object within HQL query. And one of the parameters to be provided in the new Object constructor is a list of some other objects. eg: SELECT new Object1(a.id, new List(SELECT b FROM table2 AS b WHERE b.id>0)) FROM table1 AS a; So I would be getting an object of type Object1 which has a list retrieved from another table. Please do help out.. 回答1: You can't do it in one statement as you plan to. Think in a different way. There are some