2. Make a Java Entity Class Model

The starting point for making a Java Entity class model is an OO class model like the one shown in Figure 1.10.

As explained before, we obtain the Java Entity class Publisher from the corresponding OO design class by (1) making all properties private, (2) using Java datatype classes (String, Integer, etc.), (3) adding the stereotype «get/set» to properties (specifying public getters and setters), (4) adding a toString function, (5) adding the (class-level) data storage methods create, retrieve, update and delete:

In a Java Entity class model, for any association end dot in the OO class model, we show the reference property representing the association end and annotate it with the functionality type of the unidirectional association represented by it. In our example, we add a reference property publisher in the entity class Book and annotate it with the association's functionality type manyToOne: