考虑以下语句:
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
在哪里:
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
如何指定 Hibernate 将从中检索配置数据的文件?解释一下,我有一个带有正确配置数据的 hibernate.cfg.xml,但是在运行时 hibernate 会抛出引用来自其他项目的配置的错误,例如:
org.hibernate.MappingNotFoundException: resource: xx/AnotherNonRelatedProject/CertainClass.hbm.xml not found
无论如何,我猜默认配置来自另一个文件。但我已经搜索了我的 hbm.xml 文件、类和引用,似乎没问题。
知道这里会发生什么吗?
Eclipse:靛蓝 SR2;休眠工具:3.5.1
谢谢!