I have two classes **Employee** and **Department**.

```
public class Employee {
  int empId;
  String empName;
  Boolean isEmpAvailable;
  String empAddress;
  Department department;

 }

public class Department {
   int deptId;
   String deptName;
  }

```

I have created hibernate files files for both classes Department.hbm.xml and Employee.hbm.xml

I like to update the column isEmpAvailable in the table Employee basing on a deptid in Department table.

Here I am facing problem with update query which I am not clear after reading in online documentation

```
       public void updateEmployee(Employee emp, Department deptid){
          String query= " update Employee set isEmpAvailable=? where deptid=?   
          Object[] values= {"true","133"};
          getHibernateTemplate.update(query,values);
        }

```

When i run the code the column doesn't get update. A error is thrown as 
 Entity not recognized: update Employee set isEmpAvailable=? where deptid=?

I have read online docs which have methods of getHibernateTemplate() which have return type as integer. Here I like to update the database directy by calling dao.updateEmployee without any returntype. I am unable do it. Please suggest me