public boolean isEmailExist(String email) {
        Session session =null;
        try {

            session= HibernateUtil.getSessionFactory().openSession();
            session.beginTransaction();
            Criteria criteria = session.createCriteria(User.class);
            if(criteria.add(Restrictions.eq("email", email))
                    .uniqueResult()!=null)
            {
                session.getTransaction().commit();
                return true;
            }
        } catch (Exception exception) {
        } finally {

            if(session!=null && session.isOpen())
            {
                session.close();
            }
        }
        return false;
    }