-->
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 ...
PostPosted: Fri Feb 04, 2005 5:40 pm 
Newbie

Joined: Tue Dec 21, 2004 5:30 pm
Posts: 7
Hey All

Is there any to lazily load an attribute of an object..(not colleciton). Suppose i have an object Image which contains an attribute of type byte array which contains binary data. Is there any way to load this attribute lazily ?

Regards
Kaleel


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 05, 2005 6:37 am 
Newbie

Joined: Wed Sep 01, 2004 9:04 am
Posts: 18
Location: Enschede, Netherlands
<class name="..." lazy="true">

See: http://www.hibernate.org/hib_docs/reference/en/html/mapping.html#mapping-declaration-class


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 05, 2005 7:34 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
at property level, you can do this with hibernate 3

with H2, check lightweight class on wiki
http://www.hibernate.org/41.html

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Sat Feb 05, 2005 2:46 pm 
Newbie

Joined: Tue Dec 21, 2004 5:30 pm
Posts: 7
Thanx a lot folks!!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 11, 2005 12:32 am 
Newbie

Joined: Mon Jan 17, 2005 7:32 am
Posts: 13
basterbrugge wrote:



Hi I'm having problem implementing this to Spring-Hibernate integration... perhaps you could give some specific details or tutorial to this?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 11, 2005 5:02 am 
Newbie

Joined: Mon Jan 17, 2005 7:32 am
Posts: 13
rdeguzman55 wrote:
basterbrugge wrote:



Hi I'm having problem implementing this to Spring-Hibernate integration... perhaps you could give some specific details or tutorial to this?



I resolve the problem by just following this tutorial:

http://www.jroller.com/comments/kbaum/W ... o#comments

and right implementation:

I solve my problem finally.... after searching through the net the answer lies in:

protected void setUp() throws Exception {
super.setUp();
userDao = (UserDAO) ctx.getBean("userDAO");
accountDao = (AccountDAO) ctx.getBean("accountDAO");

sessionFactory = (SessionFactory) ctx.getBean("sessionFactory");
Session session = SessionFactoryUtils.getSession(sessionFactory, true);
TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session));
}

protected void tearDown() throws Exception {
super.tearDown();
userDao = null;
accountDao = null;

// unbind and close the session.
SessionHolder holder = (SessionHolder) TransactionSynchronizationManager.getResource(sessionFactory);
Session s = holder.getSession();
s.flush();
TransactionSynchronizationManager.unbindResource(sessionFactory);
SessionFactoryUtils.closeSessionIfNecessary(s, sessionFactory);
}


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.