From the course: Java Database Access with Hibernate

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Hibernate mapping file

Hibernate mapping file - Java Tutorial

From the course: Java Database Access with Hibernate

Start my 1-month free trial

Hibernate mapping file

- [Instructor] Here is my hello world example project. I have my reverse engineering file, as well as my configuration file. What I need now is I need to use the reverse engineering file to generate my mapping file, as well as my class file for any tables that exist in my database. In our case it's fairly simple we only have one table called Message. Let's go ahead and get started. So I'm going to click on helloworldexample package, I'm going to right-click and go to New, and I'm going to choose Hibernate Mapping Files. Notice that at the bottom we have Other. So if Hibernate Mapping Files is not there for you, go to Other, go to Hibernate for the category, and choose Hibernate Mapping Files in POJOs from database. Leave the configuration file and the reverse engineering file and go ahead and put a check mark next to JDK 5 Language Features and click finish. At this point you might have noticed two new files were added to my helloworldexample package. We now have Message.hbm.xml and…

Contents