i trying populate set of child objects in parent objects.
`
//parent class @table(name = "retail") public class retail implements serializable{ @onetomany(mappedby = "retail", fetch = fetchtype.eager) private set<address> address //child class @manytoone @joincolumn(name = "cid", referencedcolumnname = "cid") private retail retail; //service class list<criterion> criterionlist = criterionbuilder.buildretailcritlist(csr); list<retail> retaillist = (list<retail>)retaildao.getbycriteria(criterionlist);
`
at first, seems work. can access set of child objects in each parent object. on closer inspection, however, there more parent objects returned expected (in "retaillist"). looks happens because hibernate doing left outer join on parent , child tables. not goal. i'm trying return original parent objects, have set of child objects inside each of them.
any hints or tips appreciated. thanks.