Legacy application
If you are working with a legacy application, there are a few considerations to keep in mind, such as reverse engineering and modernization. Let's discuss those here.
Reverse engineering
There are times that you just want to migrate your data access from another technology—such as raw JDBC, Spring JdbcTemplate, or MyBatis to Hibernate.
The JBoss team offers a very nice eclipse plugin that provides very useful functionalities, such as model viewer, mapping diagram HQL editor, and reverse engineering. Using this feature, you can extract enough information from the database (using the appropriate database dialect) to generate Hibernate mapping files, Java classes, annotations, and more. We will not discuss the steps for reverse engineering an existing database, as clear instructions are available online. For further information, visit http://tools.jboss.org/features/hibernate.html.
We would like to share a few useful hints to help you create better maps when reverse engineering...