Creating a Hibernate Reverse Engineering File

另请参见

To use the Hibernate Mapping Files and POJOs from a Database wizard, you need to first create a Hibernate reverse engineering file (hibernate.reveng.xml). The IDE provides a wizard for generating the file based on the data contained in the Hibernate configuration file and the tables you are using in your application.

The reverse engineering file is an XML file that can be used to modify the default settings used when generating Hibernate files from the metadata of the database specified in hibernate.cfg.xml. The file can be used to explicitly specify the database schema that is used, to filter out tables that should not be used and how JDBC types are mapped to Hibernate types.

To create hibernate.reveng.xml using the New File wizard:

  1. 打开“新建文件”向导。
  2. Select Hibernate from the Categories list and Hibernate Reverse Engineering Wizard from the File Types list. 单击“下一步”。
  3. Type hibernate.reveng for the name and specify the Folder where you want to save the file. 单击“下一步”。
  4. Select the Configuration File from the drop down list.
  5. 在“可用表”窗格中选择任何表,然后单击“添加”以将表移至“选定表”窗格中。与选定表相关的任何表将自动添加到“选定表”窗格的列表中。
  6. 单击“完成”。

When you click Finish, the file hibernate.reveng.xml is created in the location you specified and the file opens in the Source Editor.

另请参见
关于 Hibernate 支持
编辑 Hibernate 配置文件
创建 Hibernate 映射文件
在项目中添加 Hibernate 支持

法律声明