Database Reference
In-Depth Information
• The delete operation: The following code shows the deletion of the
employee record:
// delete employee record.
em.remove(foundEmployee);
// Find deleted employee record, it should be null.
Employee deletedEmployee = em.find(Employee.class, "1");
System.out.println("After deletion employee object is"
+ deletedEmployee);
// close em instance.
em.close();
// close emf instance.
emf.close();
Once the employee record is deleted, run the scan command to verify
the successful record deletion, as shown in the following screenshot:
 
Search WWH ::




Custom Search