public Priority getByValue(String value) {
        Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Priority.class);
        criteria.add(Restrictions.eq("value", value));

        return (Priority) criteria.uniqueResult();
    }