Ensuring the persistence of a Java data model¶
Context¶
A Java application is being developed, and the persistence of a part of the application’s data model must be ensured.
Solution¶
- Transform the part of the Java data model concerned into a persistence model. To do this, use the “Transformation: UML Class Model to Hibernate Persistence Model” command.
- Generate the persistent model’s Java classes and the associated Hibernate files using the “Hibernate & Java Generation” command.
- Transform the data model into an SQL table model using the “Transformation: Data Model to Table Model
” command.
- Generate the SQL database script from this table model using the “Generator: SQL script” command.
You have just produced your application’s Java data model, your database’s SQL script and the Hibernate mapping files used to ensure object/relational mapping between the Java objects and the database.