-->
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: Is it possibly to return a class property using criteria?
PostPosted: Fri Feb 10, 2006 5:56 pm 
Regular
Regular

Joined: Thu Jul 29, 2004 11:55 pm
Posts: 75
Hi,

I am using Hibernate 3.1.x and I was wondering if it is possible to return just a single property using criteria. I don't see any mention or example in the reference guide. I know it can be done using HSQL, but i would prefer to keep everything as Criteria. Any help would be greatly appreciated. Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 24, 2006 9:42 pm 
Regular
Regular

Joined: Thu Jul 29, 2004 11:55 pm
Posts: 75
Just in case someone else needs the answer, you use criteria.setProjections(Projections.property("name"));

For more than one, use Projections.ProjectionList().add(Projections.property("name"));


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.