HiberObjects

Download

Order

Forum

Vote for this plugin

Design Classes

Create a Project

You can either create a new HiberObjects project from scratch with the wizard, or add HiberObjects capabilities to an existing Eclipse project. (See the Help pages about this.)

Select File -> New -> Project, HiberObjects - HiberObjects Project.

This will create a new Java project with the HiberObjects nature enabled. It will set up 3 source directories: src, test and conf. An initial class diagram can be created.

Project Explorer

Open the Project Explorer view: Window -> Show View -> Other, and then select General - Project Explorer.

A HiberObjects node shall be visible in the project. Designed packages, diagrams and classes will be displayed under this node.

Create a Package

In the Project Explorer view, right click on Object Design and select New -> Package. Enter package name: flight.model.

Create a Class Diagram

Right-click on the package and select New Class Diagram. Enter the name "Flight". This will open a class diagram where classes, associations, attributes and operations can be created.

Design Classes

Right-click in the diagram and select New -> Class and type the class name in the symbol that appears.

To create an attribute, right-click on the class symbol, select New -> Attribute and then type the access, type and name of the attribute.

The following symbols are used for access an attributes, operations and associations:
+ for public
- for private
# for protected
nothing for package protected

To create an association, select the button, click on the first class and then on the second class. Unidirectional associations can be created with the button, aggregates with and composites with .

Right click on the association end to change the multiplicity to 0..1, 1 or * (many). Break points can be inserted by dragging the line.

Here is an example of some classes for a ticket ordering application:

The uniqueConstraints tag for the Airport class will generate unique constraints annotations for JPA. Read more about how to design JPA annotations or configure Hibernate mapping.

When this diagram is saved, 4 Java classes will be created. If the platform is Hibernate, 4 .hbm.xml files will also be generated. These files are used by Hibernate to map Java classes to database tables.

Arrays and Lists

Attributes, operations and parameters may be designed as arrays or lists as follows: