。。一般有了Spring的话都轮不到hibernate.cfg.xml出现了吧,主流思路是
把hibernate的配置集成到applicationContext.xml中。
把hibernate.cfg.xml注入到sessionFactory里。
如果你要用Configuration,configure方法有个参数,可以指定路径的。不过应该只能读取hibernate.cfg.xml而不是applicationContext.xml