@Transactional
    public Task createTask(Integer journalId, String name) {
        Journal journal = journalsDao.getById(journalId);
        if (journal == null) {
            throw new RuntimeException("No such journal");
        }

        Task task = new Task();
        task.setName(name);
        task.setJournal(journal);
        task.setStatus(statusesDao.getByValue(Status.DEFAULT_VALUE));
        task.setPriority(prioritiesDao.getByValue(Priority.DEFAULT_VALUE));

        task.setId(tasksDao.save(task));

        return task;
    }