有没有办法在 netbeans/eclipse 中自动生成 hibernate.cfg.xml 文件?

Is there a way to auto-generate hibernate.cfg.xml file in netbeans/eclipse?

其实我在学习jpa,所以我必须通过例子来学习。 我发现手动创建hibernate很烦人, 每次我必须复制并粘贴该文件的结构 所以我在想是否有任何解决方案可以通过 netbeans/eclipse 自动生成“hibernate.cfg.xml”文件?

  • Netbeans 如果您创建一个使用 Hibernate 的 Web 应用程序项目(请参阅 Using Hibernate in a Web Application). According to this guide 上的 Netbeans 文档,您也可以创建一个 hibernate.cfg.xml hibernate.cfg.xml 文件使用 NewOther 然后在 Hibernate Configuration Wizard =17=]Hibernate组.
  • Eclipse 中,Hibernate 工具插件提供了一个向导来创建 hibernate.cfg.xml 文件(参见 JBoss Hibernate Tools documentation)。

编辑: 添加有关 Netbeans 文件向导的信息。