-->
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.  [ 1 post ] 
Author Message
 Post subject: runtime lazy loading
PostPosted: Tue Jul 14, 2009 9:19 am 
Newbie

Joined: Tue Jul 14, 2009 9:03 am
Posts: 1
Hi

I am using spring-hibernate and usinf HibernateDaoSupport in my DAO layer.

Since my service layer is both accessed by web and flex (using remoting).

I want to set lazy loading to true in case of some services which are accessed by FLEX.
Can i set lazy="true" at runtime for particular call only so that data of sets mapped does not go over network to speed up flex calls.

I tried this but it did not work for me as I am using hibernateTempalte for my HQL

Code:
LocalSessionFactoryBean sess=getConfig();//gets LocalSessionFactoryBean  from context
         Configuration cfg=sess.getConfiguration();

         PersistentClass pClass=cfg.getClassMapping("Users");
         pClass.setLazy(true);
          Property prop=pClass.getProperty("state");
         prop.setLazy(true);

List results = getHibernateTemplate().findByExample(instance);


Now when from list i fetch Users and check state object it is coming initialized. So setLazy does not work.

Thanks,
Harpreet


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.