Creating Hibernate Mapping Files

See Also

Hibernate mapping files are XML files that contain object relational mapping (ORM) data that Hibernate uses to determine how classes are mapped to table columns and primary keys.

You can use the following wizards to generate Hibernate mapping files:

To create a Hibernate mapping file for a class:

  1. Right-click the package node containing the class to be mapped and choose New > Other to open the New File wizard.
  2. Select Hibernate from the Categories list and Hibernate Mapping File from the File Types list. Click Next.
  3. Type <CLASS_NAME>.hbm for the file name, where <CLASS_NAME> is the name of the class that you want to map. Click Next.
  4. Specify the Class that you want to map to a table.

    You can click the button to locate the class.

  5. Choose the corresponding database table from the drop down list. Click Finish.

When you click Finish, the mapping file is created in the source package you specified and the file opens in the Source Editor. The Hibernate configuration file is modified to specify the mapping file.

See Also
Creating the Hibernate Configuration File
Editing the Hibernate Configuration File
Adding Hibernate Support to a Project
About Hibernate Support

Legal Notices