Creating the Course entity

Let's now create the Course entity. Right-click on the project and select the JPA Tools | Generate Tables from Entities menu:

Figure 8.8: Generate course entity

Make sure that CourseMgmtDBConnection is selected (refer to the Configuring JPA section of Chapter 7, Creating JEE Applications with EJB, for configuring a MySQL database connection in Eclipse) and that List generated classes in persistence.xml is selected. Click Next on this and the next page. On the Customize Defaults page, select identity as the Key generator and set the package name as packt.jee.course_management_jpa.entity:

Figure 8.9: Customize JPA ...

Get Java EE 8 Development with Eclipse now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.