@Override
    public List<UserDTO> getAllUsers() throws SQLException {
        Session session = null;
        List<UserDTO> users = new ArrayList<UserDTO>();
        try {
            session = HibernateUtil.getSessionFactory().openSession();
            users = session.createCriteria(UserDTO.class).list();
        } catch (Exception e) {
            System.err.println("Error while getting all the users!");
        } finally {
            if (session != null && session.isOpen()) {
                session.close();
            }
        }
        return users;
    }