Home /
Expert Answers /
Computer Science /
please-the-following-nbsp-question-in-java-programming-language-this-question-will-test-you-on-creat-pa643
(Solved): please the following question in Java programming language This question will test you on creat ...
please the following
question in Java programming language
This question will test you on creating a Java application that utilises JPA and JSF to perform CRUD operations on a database. 2.1 Develop a Java Enterprise Application using NetBeans that consist of the following: i. A database that has a table that will store student details of students registered for the ITEJA3 module. The table should be structured as follows: - Ensure that you include an Entity Class that will contain all the getters and setters for the above table. You will also require a Managed Bean class for the table. You will also need to include a persistence.xml file. This will contain the persistence unit name as well as the necessary database configurations that will enable your Java Enterprise application to communicate with the database. You are welcome to use any Relational Database Management System (RDBMS) you are comfortable with.
When a user enters a student name and the register button is clicked, the student record must be added to the database by using a method you created in the Java class in (iv) and the user must be redirected to another JSF page which shows all the student records in the database. Figure 4 below shows the results after successfully registering one student to the database. A JSF page which displays a list of all the registered students in the ITEJA3 module. Create a method in the Java class in (iv) to display this list.
Figure 5 below shows the list of registered students after successfully registering six students Figure 5: All registered students list JSF page Souree: Makia \( 5 \mathrm{M} \) (2002) The JSF page must also have a button called "Register New Student" will simply direct the user to the JSF page to register a new student. The JSF page must also have a button called "Delete" which will simply delete the student record from the database through using a method you defined in the Java class in (iv). After its clicked, the page must be updated to show that the student record has been deleted from the database. A JSF page for updating student details. This page should be linked to the update button on the list of registered students in Figure 5 above. The page should fetch the student record using the ID, then allow the user to update the student's name using a method you defined
Figure 6 above shows that the student with ID 6 is being updated the name from Kagiso Mohlare to Palesa Mohlare. After successfully updating the student's name, a message must be displayed on a label as shown below: Update Student Record Id: Updated Name: View Registered Students Student With ID #6 has been updated sucessfully in the database.
The JSF page must also have a link which will take the user back to the list of registered students. Figure 8 below shows the list of registered students after performing the update operation of the user with ID number 6 as shown in Figure 7 above. Figure 8: Student List page showing updated entry Source: Makura S.M (2022) Your Java application must have a Java class where you perform all the CRUD operations listed above. Ensure that you utilise the JPA EntityManager interface as well as the Java Persistence Query Lanauage (JPQL) when interacting with the database,
Figure 9 below shows the student details as shown in a MySQL database. You are welcome to use any Relational Database Management System (RDBMS) you are comfortable with. Figure 9: list of registered students as seen from the database Source: Makura S.M (2022) Ensure that your application handles basic exceptions. Note: If you develop a Basic Java application that performs CRUD operations but does not utilise JPA and JSF, you will get extensive mark deductions.