-->
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.  [ 3 posts ] 
Author Message
 Post subject: [Performance] Select only some properties of the entity
PostPosted: Thu Jan 26, 2006 8:25 am 
Beginner
Beginner

Joined: Mon Jan 31, 2005 11:04 am
Posts: 21
Hi,

I would like to only select some properties of my object entity for performance reason.

I know I can use HQL and the "select" clause. Unfortunately I find this way of working not efficient because I reveive a list of Object[] that I have to iterate over. It becomes much worth if you have a tree like structure in your database model. A->0-n B->0-n C->0-n D

I would still like to use the Criteria way to query my database.

Is there a way to achive that? Or is there a way to easily parse and map a list of Object[] into an Entity object?

schuer


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 11:23 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
sue either select new MyObject() ...
or enhance your class and use lazy=true on properties (not recommended)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 11:26 am 
Beginner
Beginner

Joined: Mon Jan 31, 2005 11:04 am
Posts: 21
Emmanuel,

That would maybe be a good feature request to have a method like:

Criteria.setLazy(String property, boolean b)

Bruno


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.