Пример #1
0
 /*
  * Since the method is running with Transaction, No need to call hibernate update explicitly.
  * Just fetch the entity from db and update it with proper values within transaction.
  * It will be updated in db once transaction ends.
  */
 public void updateEmployee(Employee employee) {
   Employee entity = dao.findById(employee.getId());
   if (entity != null) {
     entity.setName(employee.getName());
     entity.setJoiningDate(employee.getJoiningDate());
     entity.setSalary(employee.getSalary());
     entity.setSsn(employee.getSsn());
   }
 }
Пример #2
0
 public Employee findEmployeeBySsn(String ssn) {
   return dao.findEmployeeBySsn(ssn);
 }
Пример #3
0
 public List<Employee> findAllEmployees() {
   return dao.findAllEmployees();
 }
Пример #4
0
 public void deleteEmployeeBySsn(String ssn) {
   dao.deleteEmployeeBySsn(ssn);
 }
Пример #5
0
 public void saveEmployee(Employee employee) {
   dao.saveEmployee(employee);
 }
Пример #6
0
 public Employee findById(int id) {
   return dao.findById(id);
 }