コード例 #1
0
 /**
  * @param id
  * @return employee object
  */
 public Employee getEmployeeById(Long id) {
   return entityManager.findById(Employee.class, id);
 }
コード例 #2
0
 /** @return a list of employees */
 public List<Employee> getAllEmployees() {
   EntityManager entityManager = new EntityManagerImpl();
   return entityManager.findAll(Employee.class);
 }
コード例 #3
0
 /**
  * @param employee
  * @return employee object
  */
 public Employee updateEmployee(Employee employee) {
   return entityManager.update(employee);
 }
コード例 #4
0
 /** @param employee */
 public void deleteEmployee(Employee employee) {
   entityManager.delete(employee);
 }
コード例 #5
0
 /**
  * @param employee
  * @return employee object
  */
 public Employee insertEmployee(Employee employee) {
   return (Employee) entityManager.insert(employee);
 }