This class diagram is incorrect because there is confusion between Java EE stereotypes and class names!
What are the stereotypes of << class module>> , << module>> and Session , Session persistence names should be Java EE stereotypes. If it is stored in the database, then this is the essence! Perseverance etc. It can be written by attributes. This chart does not make sense!
The main advantage of the diagram in this diagram is that if you use a code generator such as AndroMDA, MIA software or Blue Age, then you can generate your database directly from the model. These tools look at stereotypes during code generation.
If you do not want to generate code from the model, but prefer that the hibernate mapping do the job, then the entity stereotype can be written as an annotation in your Java code. Then, thanks to live code and model synchronization, hibernate can take the annotation and create a mapping.
That's why stereotyping is really very important, and using the wrong stereotype can be a very serious mistake!
source share