Hibernate Configuration Step by Step Process
Hibernate Configuration Step by Step Process
This tutorial explain how to perform hibernate reverse engineering using eclipse.
First of all before we start you need to install Hibernate Plugin in Eclipse
Select one option. Here i selected following option because i am using Eclipse Indigo ::: >>
JBoss Tools 3.3 Development Milestone (requires Eclipse 3.7.2 Indigo SR2)
Now copy page URL and Goto Help > Install New Software.. paste URL in Work with Textbox as shown in
below image.
Create Project Structure as shown in below image.
Here i create new project with name omtHibernate and package com.omt.main.
2.javax.persistence.jar
3.mysql-connector-java-5.1.21-bin.jar
Now open hibernate perspective Goto Window > Open Perspective > Other.. as shown in below image.
Select Hibernate.
Now Create Database. Here i use mysql to create database.
1. student
2. address
1. student table :
add foreign key in student table as shown in below image.
2. address table :
Press right click on src folder and create new hibernate.cfg.xml file.
Add following properties in it.
Press Next and then press Finish button.
Press right click on project folder and create new file in project folder hibernate.reveng.xml as shown in
below image.
Add Following properties in it.
Now select top most small icon and select Hibernate Code Generation Configuration… as shown in below
image.