Hibernate added improvements over the years, including changes and additions. Hibernate Tools supports all the major versions.
It also support the three variations for previous versions of Hibernate: core for hbm.xml, annotations for hibernate annotations and JPA for Java Persistence style projects.
Hibernate Tools provide a code generation launch configuration which can take the configured Hibernate model and use for various code generation tasks.
Since it is a launch configuration it is easy to run it repeatedly while developing via the Launch Configuration menu.
When reverse engineering you have control over various global aspects of the translation from your database to the persistence model.
For example wether optimistic locking should be detected and used, making columns that look like they are an version or timestamp will be used for optimistic locking.
Wether many-to-many tables should be detected or mapped as one-to-many instead.
Finally if you want full control you can provide a reveng.xml
file or even a
class that implements ReverseEngineeringStrategy
giving you even more finegrained control.
The Exporters allow you to generate various unique artifacts in bulk. For example to generate Java, old hbm.xml mappings and schema documentation in one go.
Each of the exporters can use the globally configured options or you can choose to override/customize them in the properties section.
With the Criteria Editor you can use the full power of the Java language. Right click on an Entity or property, choose 'Criteria Editor' and the editor will be pre-filled with the Criteria code needed for querying it.
The Criteria editor auto imports all the Hibernate classes and your model classes and it will visualize the last returned java object. If the returned object is a query or criteria it will execute it before visualizing it.