public Task getById(Integer taskId) {
        Criteria criteria = sessionFactory.getCurrentSession().createCriteria(Task.class);
        criteria.add(Restrictions.eq("id", taskId));

        return (Task) criteria.uniqueResult();
    }