From the course: Building RESTful Web Services with DropWizard

Unlock this course with a free trial

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

Create your data model

Create your data model

- [Instructor] In this chapter, we're going to start working on our model, and show you examples of how you would do this in the Dropwizard application. So let's go ahead and do that. So the first thing we're going to do, is go into the Core section here, and then we're going to create a file which will return all the elements of our main data point, which is a person. So let's go ahead and create that. So in the Core folder, click on Create New File, and we're going to call this person.java. And now what we're going to do is import a few things. So let's go ahead and do that. So let's import javax.persistance.Column, and then let's copy that line here, and paste it again, and then this time we're going to import Entity. Let's paste it again, and we're going to import GeneratedValue. Generated. Value. One more time, GeneratedType. And everything that we're importing here is going to allow us to persist our…

Contents