From the course: Building RESTful Web Services with DropWizard

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Create the database class

Create the database class

- [Instructor] Okay, so now we're going to work on the class that will take care of the database. So let's go ahead and do that. So we're going to go into the database folder and then click on Create new. We're going to call this Person DAO.java. And let's go ahead and import a few things first. So let's go and import from io.dropwizar.core.Person. So we're basically importing what we just written in the previous videos. Then we're going to import io.dropwizard.hibernate.AbstractDAO. Then we're going to import org.hibernate.SessionFactory, which we're going to use shortly. And also import org.hibernate.query.Query, like so. And finally, we're going to import a few utilities from java so util.list. We're going to use a list. And then let's just copy that line. It's going to go faster unless you are a fast typer. Like so. And come to think of it that would have been faster just to type it.…

Contents