public void setFinishedById(Integer id, boolean isFinished) {
        String query = "update Task set isFinished = :isFinished where id = :taskId";
        sessionFactory.getCurrentSession().createQuery(query)
                .setInteger("taskId", id)
                .setBoolean("isFinished", isFinished)
                .executeUpdate();
    }