示例#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 findById(int id) {
   return dao.findById(id);
 }