Creating a course entity bean and a JPA factory

If you are not familiar with JPA, refer to the JPA concepts section in Chapter 4, Creating JEE Database Applications.

We will now create Course.java in the packt.book.jeeeclipse.wildflyswarm.coursemanagement.rest package:

package packt.book.jeeeclipse.wildflyswarm.coursemanagement.rest;// skipping imports to save space@Entity@Table(name="\"Course\"")@NamedQuery(name="Course.findAll", query="SELECT c FROM Course c")public class Course implements Serializable {  private static final long serialVersionUID = 2550281519279297343L;  @Id  @GeneratedValue(strategy=GenerationType.IDENTITY)  @Column(name="id")  private int id;  @NotNull  @Column(name="name")  private String name;  @Min(1) @Column(name="credits") ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.