Ejemplo n.º 1
0
 @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;
 }
Ejemplo n.º 2
0
 @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);
 }