@Override @Transactional public void deleteSingleTeamTag(TeamTag teamTag) { TeamTag newTeamTag = teamTagPersistence.reload(teamTag); if (newTeamTag != null) { teamTagPersistence.deleteTeamTag(newTeamTag); } }
@Override @Transactional public List<TeamTag> save(Team team, Set<Tag> tagSet) { Team teamToFind = teamPersistence.reload(team); if (teamToFind != null) { teamTagPersistence.deleteTeamTagsWithTeam(teamToFind); if (tagSet != null) { List<TeamTag> savedTeamTags = new ArrayList<>(); for (Tag tag : tagSet) { TeamTag teamTag = new TeamTag(teamToFind, tag); TeamTag savedTeamTag = teamTagPersistence.saveTeamTag(teamTag); savedTeamTags.add(savedTeamTag); } return savedTeamTags; } } return null; }
@Override @Transactional public TeamTag saveSingleTeamTag(Team team, Tag tag) { Team teamToFind = teamPersistence.reload(team); Tag tagToFind = tagPersistence.reload(tag); if (teamToFind != null && tagToFind != null) { TeamTag teamTag = new TeamTag(teamToFind, tag); return teamTagPersistence.saveTeamTag(teamTag); } return null; }
@Override @Transactional(readOnly = true) public Page<TeamTag> findTeamsWithTag( Pageable pageable, TeamTagSearchFilter teamTagSearchFilter) { Set<Tag> tagSet = teamTagSearchFilter.getTagSet(); Set<Tag> newTagSet = new HashSet<>(); for (Tag tag : tagSet) { tag = tagPersistence.reload(new Tag(tag.getId())); if (tag != null) { newTagSet.add(tag); } } teamTagSearchFilter.setTagSet(newTagSet); return teamTagPersistence.findTeamsWithTag(pageable, teamTagSearchFilter); }
@Override @Transactional(readOnly = true) public TeamTag reload(TeamTag teamTag) { return teamTagPersistence.reload(teamTag); }
@Override public Page<TeamTag> findAllTeamTagsWithTeam(Pageable pageable, Team team) { return teamTagPersistence.getAllTeamTagsForTeam(pageable, team); }