从hibernate中了解到,最好的办法是在
hibernate.cfg.xml文件中定义映射,并在中定义其他配置
hibernate.properties。
另一种配置方法是在名为的文件中指定完整配置
hibernate.cfg.xml。此文件可以用作文件的替换,
hibernate.properties或者如果两者都存在,则可以覆盖属性。
hibernate.cfg.xml一旦必须调整Hibernate缓存,它也将更加方便。您可以选择使用hibernate.properties或
hibernate.cfg.xml。两者是等效的。
您可以在以下链接中阅读有关此内容的更多信息:
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-
configuration.html



