-->
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: Lazy-load part of entity
PostPosted: Sat May 08, 2004 3:43 am 
Newbie

Joined: Wed Sep 17, 2003 5:15 am
Posts: 9
Hm..can't find in DTD and documentataion: can Components can be load-on-demand?

I have entity object, which have one property - text, mapped to CLOB, and the size of this text can be rather big (about 1Mb for instance)

I have 2 web-pages:
1 - displays my entities info, without that text.
2 - displays detailed info about entity.

So, i wonder can i use some kind of lazy-load for this property, because now
it's become a perfomance problem. Hibernate queries all this CLOB text, and it slowwww ;(

Your help is very appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 08, 2004 7:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Use lightweight class pattern (in the Wiki) or use a real sql.Clob as class property, which is lazy by nature.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 10, 2004 11:53 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hum we should write some materials on that in the wiki area.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 09, 2004 12:04 pm 
Beginner
Beginner

Joined: Fri Feb 20, 2004 6:15 pm
Posts: 38
I have this same issue. I have a large byte[] as a property of a dependent component (i.e. it's not an entity so I can't split it up as a different class). I just want that one property to be lazy loaded, not all the others.

Is it really true that the only way to accomplish this is by modifying your class structure?

I'm still trying to discover the elegance everyone says about Hibernate. Every time I need to do something that's more than a simple case, I find Hibernate to largely intrude on my design and require custom code for mappings.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 5:57 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
alchemista wrote:
I have this same issue. I have a large byte[] as a property of a dependent component (i.e. it's not an entity so I can't split it up as a different class). I just want that one property to be lazy loaded, not all the others.

Is it really true that the only way to accomplish this is by modifying your class structure?

I'm still trying to discover the elegance everyone says about Hibernate. Every time I need to do something that's more than a simple case, I find Hibernate to largely intrude on my design and require custom code for mappings.

Is is true that we prefer the use of projection rather that property-level lazy fetching, and it is the reason why it is not /yet/ impelmented in Hibernate.
So, you don't strictly have to modify your domaion model. What other domain model modification you had to do?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 7:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Alright, alright we will add bloody lazy property fetching.

Your code will be slow but "elegant". All those "elegant" n+1 selects that make your DBA so happy...

I am sick of trying to teach people how to use projection.


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.