SSH中的hbm.xml定义的orm映射发生的时间

SSH中将利用到org.springframework.orm.hibernate3.LocalSessionFactoryBean,即利用spring框架来处理hibernate问题(其实struts也是交由spring管理),故spring环境的加载时间即为orm映射时间,就是根据实体类生成对应的数据表的时间。spring环境的加载是交由tomcat管理的 。因为web.xml中配置了监听:<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>,即当tomcat启动时就会加载spring环境,从而根据spring配置文件applicationContext.xml创建相关的类(实例化action类等等,此时也发生orm映射,在数据库中建立表格)。

猜你喜欢

转载自yzl495.iteye.com/blog/2388169
今日推荐