I have a Contact class with the following properties: private long objectId; private String firstname; private String lastname; private String middlename; private String companyName; private String title; private String suffix; private Date anniversary; private Set<Group> groups;
I am trying to use Projections and just retrieve the firstname and groups using the following code
ProjectionList pList = Projections.projectionList(); pList.add(Projections.property("firstname"), "firstname"); pList.add(Projections.property("groups"),"groups"); criteria.setProjection(pList); criteria.setResultTransformer(Transformers.aliasToBean(Contact.class));
But the resulting ContactRow object groups object is not populated and is coming as null.
Could anyone help on this.
|