日期:2014-05-18  浏览次数:20737 次

hibernate.properties究竟应该放在项目的什么地方?
如题
看过很多资料,有的说是在class文件夹下,有的说在etc/class下,究竟怎样,据说还有一种xml配置方法,确实如此么?

------解决方案--------------------
现在基本都用XML配置:
房在当前项目根目录下(如:src),就 new configuration().config().buildSessionFactory();
如果是包下则加上包名字如:
 hibernate.001的包
就new configuration().config("/hibernate/001/hibernate.cfg.xml").buildSessionFactory();

给分哈