public static Department returnDepartment(String deptName)
	{
        Session session = sf.openSession();
        org.hibernate.Transaction tr = session.beginTransaction();
        
        String strSql ="from Department o where o.deptName =:dn";
        Query query = session.createQuery(strSql);
        query.setParameter("dn", deptName);
        List<?> lst = query.list();
        Iterator<?> iter = lst.iterator();
        
        if (!iter.hasNext())
        {
            Department dept =  new Department(deptName);
            session.save(dept);
            
            tr.commit();
            session.close();
            
            return dept;
        }
        
        Department dept = (Department)iter.next();
        
        tr.commit();
        session.close(); 
        
        return dept;
	}