Generating Hibernate Mapping Files and POJOs from a Database

See Also

In addition to writing Hibernate mapping files and POJOs (Plain Old Java Objects) from scratch, you can also generate the mapping files and POJOs from a connected database with the Hibernate Mapping Files and POJOs from Database wizard.

To generate Hibernate mapping files and POJOs from a database:

  1. Right-click the project node in the Projects window and choose New > Other to open the New File wizard.
  2. In the New File wizard, select Hibernate Mapping Files and POJOs from Database from the Hibernate category.
  3. Select the Configuration File (hibernate.cfg.xml) and Reverse Engineering File (hibernate.reveng) from the dropdown lists.
  4. Specify any General Settings options for the generated files.
  5. Select Domain Code to generate the POJOs.
  6. Select Hibernate XML Mappings to generate the mapping files.
  7. Select an existing package from the Package drop down list or type the name of a new package.
  8. Click Finish.

When you click Finish the IDE generates the following files:

See Also
Creating the Hibernate Configuration File
Creating a Hibernate Reverse Engineering File
Editing the Hibernate Configuration File
Creating Hibernate Mapping Files
Adding Hibernate Support to a Project
About Hibernate Support
Connecting to a Database

Legal Notices