In the following HQL query,
Quote:
select new someNewObj(AliasObjTableA.Field1, AliasObjTableB.Field2, AliasObjOfTableC.Field3,
AliasObjTabA.ChildObjSet) from TableA AliasObjTableA, TableB AliasObjTableB...
where ...
;
Query q = session.createQuery(query);
the someNewObj has fields and data types correctly defined and has a constructor with including fields such as a set of child Objects "childObjSet" as is used in the constructor above. Assuming that the TableA has a set of child Objects correctly mapped in the mapping file as:
Quote:
<set name="childObjSet"
inverse="true"
lazy="false"
cascade="all">
<key column="TableAPrimaryKey"/>
<one-to-many class="TableB"/>
</set>
I get a cannot execute query exception.
Isn't there a way to write queries to get sets of child objects as above?? What is the correct way then if there are so many sets of child objects to be read for a give parent object?
-Regards
Rama