Creating a JPA project in Eclipse
For creating an EJB 3.0 entity bean we require Java Persistence API (JPA) project in Eclipse. Next, we create a JPA project in Eclipse. In the Eclipse IDE, select File | New. In the New window select JPA | JPA Project and click on Next, as shown below:
In the New JPA Project window, specify a Project name, select the default Contents directory, and select the Utility JPA project with Java 5.0. Click on Next:
In the New JPA Project window, select a JPA persistence provider under Platform. We shall be using the EclipseLink JPA persistence provider. We need a database connection for database persistence. Click on the Add connection link adjacent to the Connection select list, as shown in the following screenshot:
In the New Connection Profile window, select Connection Profile Type as MySQL, specify a connection profile name, and click on Next:
Next, specify a driver and other connection details. To add a new driver definition, click on the button adjacent to...