Creating files in JPA project
After creating "JPACRUDApplication" project, you need to follow the following steps:
-
Select "JPACRUDApplication" project and right click on it. Select New => Package
-
The following dialog box is appear on the screen. Give the package name "roseindia" and click on "Finish" button:
Now you get "roseindia" package is created under the "JPACRUDApplication" project. - Right click on project and select New => Folder:
- New Folder dialog box is appear on the screen. Give
the folder name "META-INF" in Folder name text box and
click on "Finish" button.
Now you get the "META-INF" folder is created under the "src" directory of "JPACRUDApplicataion" project.
- Right click on "META-INF" folder
and select New => File:
- New File dialog box is appear on the screen. Give a
file name "persistence.xml" in File name text box and click
on "Finish" button:
- Put the database connection and provider "org.hibernate.ejb.HibernatePersistence"
in "persistence.xml" file with persistence unit name.
- Select "roseindia" package and
right click on it. Select New => Class:
- New Java Class dialog box is appear on the screen.
Give the class name "Student" and click on
"Finish" button.
- Right click on the project and go New => Folder
- New Folder dialog box is appear on the screen. Give
the folder name "lib" in Folder name text box:
- Select all lib files which is required, copyt and
paste in "lib" folder:
- Right click on "JPACRUDApplication"
project and choose: Build Path => Configure Build Path...
- "Java Build Path" dialog box is appear on
the screen. Click on "Add Jars..." button:
- Open "JAR Selection" dialog box is appear
on the screen. Click on project and go lib then all jars file is open and
select all jars and click on "Ok" button.
- Again, click on "Ok" button
Now you get project development environment has been set. Go to the next section and create the crud files with running application.