-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Projection not working for associations
PostPosted: Mon Oct 12, 2009 3:40 am 
Newbie

Joined: Mon Oct 12, 2009 3:01 am
Posts: 3
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.


Top
 Profile  
 
 Post subject: Re: Projection not working for associations
PostPosted: Mon Oct 12, 2009 3:52 am 
Newbie

Joined: Wed Oct 07, 2009 2:35 am
Posts: 5
You may clean the same question.
Because the same topic has been opened twice. :(
Also, please I want help for my topic. "How to load dtd information from classpath"

_________________
www.bursasportv.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.