You can use the Hibernate Mapping Files and POJOs from a Database wizard to generate files for you. The wizard can generate a POJO and a corresponding mapping file for each table that you select in the wizard. The mapping files are XML files that contain data about how the columns in the tables are mapped to the fields in the POJOs. You need to have the hibernate.reveng.xml and hibernate.cfg.xml files to use the wizard.
To create the POJOS and mapping files using a wizard, perform the following steps.
- Right-click the Source Packages node in the Projects window and choose New > Other to open the New File wizard.
- Select Hibernate Mapping Files and POJOs from a Database in the Hibernate category. Click Next.
- Ensure that the hibernate.cfg.xml and hibernate.reveng.xml files are selected in the drop down lists.
- Select JDK 5 Language Features under the General Settings options.
- Ensure that the Domain Code and Hibernate XML Mappings options are selected.
- Select the Package name. Click Finish.
Login to rate this answer.