From the course: Learning Quarkus

Unlock the full course today

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

Relational databases with Hibernate

Relational databases with Hibernate

From the course: Learning Quarkus

Start my 1-month free trial

Relational databases with Hibernate

- [Instructor] So now that we've seen the basics of connecting to a database and using JDBC, we're going to take a look at what it takes to bring Hibernate into the picture with Quarkus. So let's go back into our command app and open up the pom file, and we're going to add another dependency in here. The dependency that we are going to add is Quarkus Hibernate ORM and that is of course going to come from io.quarkus And we'll allow Maven to do it's thing. All right, so let's go into source main Java And into our base package. Let's go into our Room class and let's annotate this Room class to be a Hibernate entity. So @Entity and we're going to go ahead and give it a table with a name equals Room. And now let's add a private long id. We'll annotate that with @Id. @GeneratedValue, with a strategy of identity because this is a serial object and then a column name equals Room ID. Now we're going to add a…

Contents