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