Powered by Blogger.

Saturday 23 April 2016

One-To-One Hibernate Mapping

No comments :
A one-to-one relationships occurs when one entity is related to exactly one occurrence in another entity. Thus, there will be one primary key which will be mapped with both the entities.
1. Create Database Name is mapping and Two Table are employee and employeedetail.

Open NetBeans See The Menu Bar go to the file Menu Click on the New Project(Ctrl+Shift+N) and Select Left site categories java web and Project categories to Right Site Project web Application .You have to give The Program Name "Mapping". if you wont to save Project Location you can Browse and File save on the direction place and Gone a default Place and Now uncheck/check the check box and click on the next button, select server settings and select the frameworks like Hibernate and go to the finish.

2. hibernate.cfg.xml

3. hibernate.reveng.xml

4. Employee.java

5. Employeedetail.java

6. Employee.hbm.xml

7. Employeedetail.hbm.xml

8. OnetoOnemapping.java
9. output- 

No comments :

Post a Comment

Please Write a Message for Programming or something Related issues.