-->
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.  [ 1 post ] 
Author Message
 Post subject: How to get only one object from Criteria with some joins?
PostPosted: Mon Jul 27, 2009 10:46 am 
Newbie

Joined: Thu Jul 23, 2009 2:56 pm
Posts: 3
Hello.
I've complex Criteria with several joins (createAlias for many-to-one and other relations). And after criteria.list() I got a list of Object[], where every class from join is situated in separate array item.
But I really need objects for only one base class - class for whom I had created my Criteria. For example, sessionFactory.getCurrentSession().createCriteria( Account.class, "account" ); So I need only objects of Account in result list.
If I set projection list with properties, I've got a list of Object[], where each column is in separate array item.
What should I do to get normal list of objects for my class Account?


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

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.