From the course: Java EE 8 Essential Training

Unlock the full course today

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

JPA project setup

JPA project setup - Java EE Tutorial

From the course: Java EE 8 Essential Training

Start my 1-month free trial

JPA project setup

- [Instructor] When setting up a JPA project, there are a few configurations that must be preformed. The application must be set up to connect to a data source, and a persistence unit must be configured. Let's configure our EJB project to use JPA with an Eclipse. Eclipse provides support for configuring JPA projects, which makes it pretty easy. To get started, we're just going to right-click on our project, and then we can go to configure within the menu, and select "Convert to JPA Project." This will bring up a dialogue that allows us to select our JPA version, and apply the project facet to our EJB project. So just click on "Finish," and you'll notice that when we do that, we're going to get a persistence.xml file within our project. That persistence.xml file has some GUI support within Eclipse that allows us to specify information such as the connection. Now in our case, we're going to be using a in-memory database…

Contents