-->
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.  [ 6 posts ] 
Author Message
 Post subject: Optimize data Fecthing
PostPosted: Thu Feb 26, 2004 7:32 am 
Beginner
Beginner

Joined: Thu Feb 26, 2004 6:59 am
Posts: 47
Location: Gurgaon, India
Hello,

I have worked on JDO. There is a feature in JDO that is 'fetchGroup'.

Using this fetchGroup property While fetching any object, we can

specify which property of main data object do we want to fetch and

which not.

This is helpful for improving performance and also useful while transfering

data objects from one tier to another ie to transfer optimized data.

Does Hibernate provide such kind of functionality?

Thanks,
Mohit Gupta.

_________________
Mohit Gupta
Software Engineer
Gurgaon, India


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2004 8:53 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
http://www.hibernate.org/41.html
Note that arguably Hibernate does not really need lazy property fetching, since the query language supports projection, allowing the Java code to fetch exactly the needed properties.
Plus you can use
Code:
select new MyDTOAccount(account.id, account.name) from Account account

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 1:20 am 
Beginner
Beginner

Joined: Thu Feb 26, 2004 6:59 am
Posts: 47
Location: Gurgaon, India
But if we want to fetch any data object from database using simple load or find method, as being more closer to OO approach than using queries, then how can we achieve required fetching of data.

In JDO, they provides us a feature that you can specify fetch groups in mapping file for all the properties of any data object and then can set required fetch groups to runtime configuration before fetching any data object. This will result in only required portion of any data object, not the whole.

This feature also works for detach - attach functionality, if we want to pass data object to any other tier and that in disconnected mode, as then we can disconnect required portion of data and can pass it.

So what does hibernate provide for this kind of requirement, if we dont want to use queries only that is HQL, but want to use simple load or find method.

_________________
Mohit Gupta
Software Engineer
Gurgaon, India


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 1:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This has been discussed many times before. Hibernate does not need this feature. It is a "marketting" feature that is not needed to achieve high performance at least in the case of a relational database.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 1:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
P.S. Hibernate ABSOULTELY emphasizes the use of queries. We see nothing un-OO about an object oriented query language. If you do not like writing queries you should not use Hibernate.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 01, 2004 1:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Quote:
This feature also works for detach - attach functionality


Does it?? Thats wierd, since JDO does not provide detach/reatttach functionality.


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