コード例 #1
0
 @Transactional(readOnly = false)
 public void deleteCommunity(Long communityId, Long userId) {
   Community community = userRepository.loadCommunityById(communityId);
   if (community.checkOwnership(userId) && community.getMembers().size() == 1) {
     logger.info("Deleting " + community);
     userRepository.deleteCommunity(community);
   }
 }
コード例 #2
0
 public Community getCommunityById(Long communityId) {
   return userRepository.loadCommunityById(communityId);
 }