Creating a Hibernate persistence model

Overview

By persistence model we are referring to a UML class model that has been annotated for Hibernate mapping file generation.

There are two ways of obtaining a Hibernate persistence model:

  • By manually creating a new model
  • By transforming an existing class model

Creating a new model manually

The Hibernate Designer provides a set of commands used to create a class model which is annotated for Hibernate mapping file generation.

  • RootDataModel
    Available on: UML package
    Creates the root of the persistence model.

  • DataModel
    Available on: RootDataModel, DataModel
    Creates a persistence model package.

  • Entity
    Available on : RootDataModel, DataModel
    Creates a persistent class.

  • Identifier
    Available on : Entity
    Creates an attribute that will be used as the identifier of a persistent class.

  • Attribute
    Available on : Entity
    Creates an attribute on a persistent class.

  • Relationship
    Available on : Entity
    Creates an association between two persistent classes.

  • Persistent Diagram
    Available on : RootDataModel, DataModel
    Creates a diagram dedicated to Hibernate modeling.

Transforming an existing class model

To transform an existing UML class model into a Hibernate persistence model, select the package containing the classes that you want to render persistent and check the “Persistent” tickbox in the Hibernate tab.

To carry out the opposite operation (the transformation of a Hibernate model into a class model), simply uncheck this tickbox.

The “Persistent” property

root_data_model.gif (1.06 KB) admin admin, 15 December 2015 09:45

attribute.gif (1002 Bytes) admin admin, 15 December 2015 09:45

identifier.gif (962 Bytes) admin admin, 15 December 2015 09:45

persistent_diagram.gif (1011 Bytes) admin admin, 15 December 2015 09:45

datamodel.gif (979 Bytes) admin admin, 15 December 2015 09:45

entity.gif (997 Bytes) admin admin, 15 December 2015 09:45

Hibernate_Fig3_bis_English.gif (24.1 KB) admin admin, 15 December 2015 09:45

relationship.gif (957 Bytes) admin admin, 15 December 2015 09:45

hierarchy.gif (860 Bytes) admin admin, 15 December 2015 09:45