@Transactional public WhatsNextStoryEntry addToWhatsNext(User user, Story story) { WhatsNextStoryEntry entry = new WhatsNextStoryEntry(); entry.setStory(story); entry.setUser(user); whatsNextStoryEntryDAO.store(entry); storyBusiness.addResponsible(story, user); doRankToBottomOnWhatsNext(entry); return entry; }
@Transactional private void doRankToBottomOnWhatsNext(WhatsNextStoryEntry entry) throws IllegalArgumentException { rankingBusiness.rankToBottom(entry, whatsNextStoryEntryDAO.getLastStoryInRank(entry.getUser())); }