extended example

The good news is, finally I mapped my model using Hibernate’s entities that perfectly fits to my DB model. Only this time I started with creating db tables and then force Hibernate to persist data to right table in right way.

But normally I should think in terms of object and relationships they have and don’t care about backstage operations. The thing is Hiberante is not optimal, and you cannot expect that it is very fast. Hibernate is a good tool to make something quick, without spending hours or days to write all value objects and sql queries.

UML diagrams
uml model

Entities

  1. here is the zip file with chosen entities from my project (not all of them). To unzip the file use the password ‘djshadow‘ :) hell yeah (I am using 7zip softwear)
  2. customer entity is a base class for all concern, owner, service and integrator classes. each concern can be owner as well and each integrator can be service. There is a ManyToMany relationship between service and station split into 2 OneToMany relationships that is holding additional filed for that relationship

//TODO
get reed of relationship annotations and move them to xml file where they can be changed easily without recompiling classes.

Dodaj komentarz