Open in new window

back

Editing Class Mappings

  1. To edit the Hibernate class mapping file, right-click any class and select Edit Mapping... from the context menu.

    classMapWizard

  2. On the next screen, select the inheritance tree mapping for the class. The user can set how the class will be mapped in a database. This step will be displayed only for those classes that have a persistent super class. For the topmost class this step will be skipped.

    classMapWizard

  3. After clicking Next, this screen will be displayed to allow the editing of mapping properties.

    classMapWizard

  4. After clicking Next, this screen will be displayed to allow editing the primary keys for the database table and setup a generator. You can add an existing column as a primary key, create a new a column in the table as a primary key, or remove a column as a primary key.

    classMapWizard

    Clicking on the Generator... button while a column is selected brings up a dialog box for specifying the generator based on that column. You can choose to use the built-in generator or another generator. In this dialog box, you can also establish parameters for the generator.

    classMapWizard

  5. After clicking Next on the primary key page, you can edit identification properties on the next page.

    classMapIdent

    Pressing the Map PK... button, allows you to modify or remove identification.

    classMapIdent

  6. After clicking Next on the identification properties page, you can create or remove discriminator column mappings on the next page.

    classMapIdent

    classMapIdent

  7. After clicking Next on the discriminator column mappings page, you can create or remove version property mapping on the next page.

    classMapIdent

    classMapIdent

  8. Finally, after clicking Next again, on the next page, you can set custom SQL queries to insert, update and delete what the class is mapped to.

    classMapIdent

  9. Click Finish to save all of your changes.

back