【发布时间】:2026-01-17 17:50:01
【问题描述】:
这是我第一次使用Hiberante。
我正在尝试使用以下内容在我的应用程序中创建 Hibernate session:
Session session = HiberanteUtil.getSessionFactory().openSession();
它给了我这个错误:
org.hibernate.HibernateException: /hibernate.cfg.xml not found
但是我的项目中没有hibernate.cfg.xml 文件。
如何在没有此文件的情况下创建会话?
【问题讨论】:
-
我想只使用注释来设置休眠,即在本指南中:concretepage.com/hibernate/…
标签: java hibernate hibernate.cfg.xml