-->
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: proxy blob
PostPosted: Wed Oct 01, 2003 12:28 pm 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
Hi all,

I have a class mapped to a table with a blob column. I don't want to load the blob everytime I load an instance and I prefer not using the lightweight class pattern.
Is there any way for me to achieve that ?
I first thought of a proxied component but saw that this is not possible.
I then tried to split my blob in a separate class with a one-to-one association but I saw on another thread that I can only have one object for one row in the same session : so I think this is not possible (and I can't achieve it)
Finally I am wondering if it would be possible do define a usertype for my blob which contains all the informations to initialize lazily my blob if I need it : is it something affordable ?
Is there another solution that I can try ?

Thanx

Seb


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 01, 2003 12:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use the Hibernate "blob" type. java.sql.Clob is exactly that: a proxy for a database BLOB.

(Otherwise, refer to the "lightweight" class pattern in the Wiki.)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 01, 2003 12:58 pm 
Expert
Expert

Joined: Thu Sep 04, 2003 8:23 am
Posts: 368
As I mentionned in my previous post I prefer not using LightWeight pattern in this cas.

Is the "blob" type used by default or do I have to specify type="blob" ?

My problem is that my sql statement is twice faster when I omit the blob column. As I don't want to use the LightWeight pattern I was trying to put my blob behind a proxy thus the sql call should occur only when I need the blob element.

I was wondering if it would be possible to have a usertype that stores the table and colum names and that do the call on a get method (don't no if it is possible)

Seb


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.