To solve this, simply add new Long…
criteria.add(Restrictions.eq(“departmentId”,new Long(departmentId)));
Blog at WordPress.com.