From the course: Java Database Access with Hibernate

Unlock the full course today

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

Configuration file

Configuration file - Java Tutorial

From the course: Java Database Access with Hibernate

Start my 1-month free trial

Configuration file

- [Instructor] In order to talk about hibernate and how to create a hibernate project, I think it's a good idea to start with an example. Here is a UML diagram where UML stands for Unified Modeling Language. This diagram represents the table we created inside of our message repository database. The table name, as you can tell, is message and that's the same name as the class. The class has two fields, id and message. The user won't see the id, but it's the primary key for our table which is required in our database. The id has a data type of Short and we have a message. The message is of type String. In the bottom of the diagram, we specify the methods starting with the constructor which is required for hibernate, then we have our getter and setter methods. We have getId return to Short, setId expects us to pass a Short and returns a Void, getMessage return to String and setMessage takes in a String but doesn't return anything. Okay, so that is our database table. Now one of the most…

Contents