I have table employee which has the columns EMPID, EMPNAME, EMPAGE, SALARY, ADDRESS, department_id (foreign key to department_id in department) and another table department which has department_id, name. So I made a query
List<Department> deps = sessionFactory.getCurrentSession().createCriteria(Department.class).list();
The return vlaue is a List of Lists
I want to put the result in in JSON Object. How can I achieve this?