标签:
1、取消懒加载
Configuration cfg = new Configuration().configure(); cfg.addClass(Vm.class); //设置取消懒加载 cfg.getCollectionMapping("com.chinac.chs.pojo.Room.pools").setLazy(false); SessionFactory sessionFactory = cfg.buildSessionFactory(); HibernateTemplate hibernateTemplate = new HibernateTemplate(sessionFactory);
InstanceDaoImpl instanceDaoImpl = new InstanceDaoImpl();
instanceDaoImpl.setHibernateTemplate(hibernateTemplate);
标签:
原文地址:http://www.cnblogs.com/jingyunyb/p/4326653.html