登 录 
注 册
Spring SessionFactory从bean 获取session
发布时间: 2017-03-08
浏览次数: 664
发布人:
  
bcrtjc
  •      ApplicationContext.xml设置
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    value="classpath:hibernate.cfg.xml">



    在类中获取
    WebApplicationContext wac = ContextLoader.getCurrentWebApplicationContext();
    sf = (SessionFactory)wac.getBean("sessionFactory");

  • 请说在东川区供求信息网看到此信息
CopyRight © 2014-2022 昆明英信科技有限公司 All Rights Reserved    滇ICP备14006165号-1
滇公网安备 53011302530117号