Hi, I am facing issues using nested entity with a Group By clause. I have entity Parent with child entity nested inside it and a sub child entity inside Child. I am using groupby child.subChild to retrive Parent data. But after transformation, Parent Object comes with null Child Object. Please Help
Criteria criteria = createCriteria(Parent.class) .createAlias("Child", "ch") .createAlias("ch.subCH", "subCH"); ProjectionList projList = Projections.projectionList(); projList.add(Projections.alias(Projections.groupProperty("ch.subCH"),"subCH"));*/ projList.add(Projections.alias(Projections.count("pKParentID"),"ID")); projList.add(Projections.alias(Projections.groupProperty("ParentName"),"ParentName")); criteria.setProjection(projList); criteria.setResultTransformer(Transformers.aliasToBean(Parent.class)); criteria.list();
Parent.Child comes as null
|