Skip to content

Commit 492e162

Browse files
committed
fix: 리포지토리 내 중복 코드 수정 #30
1 parent d832565 commit 492e162

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/main/java/org/dfbf/soundlink/domain/emotionRecord/repository/EmotionRecordRepository.java

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,21 @@
33
import org.dfbf.soundlink.domain.emotionRecord.entity.EmotionRecord;
44
import org.dfbf.soundlink.domain.emotionRecord.repository.dsl.EmotionRecordRepositoryCustom;
55
import org.dfbf.soundlink.domain.user.entity.User;
6-
import org.springframework.data.domain.Page;
7-
import org.springframework.data.domain.Pageable;
86
import org.springframework.data.jpa.repository.*;
97
import org.springframework.data.repository.query.Param;
108
import org.springframework.stereotype.Repository;
119

12-
import java.util.Optional;
13-
1410
@Repository
1511
public interface EmotionRecordRepository extends JpaRepository<EmotionRecord, Long>, EmotionRecordRepositoryCustom {
1612

1713
@Modifying(clearAutomatically = true)
1814
@Query("DELETE FROM EmotionRecord e WHERE e.user = :user")
19-
public void deleteByUser(@Param("user") User user);
20-
21-
Page<EmotionRecord> findByLoginId(@Param("loginId") String loginId, Pageable pageable);
22-
23-
Page<EmotionRecord> findByWithoutUserId(@Param("userId") Long userId, Pageable pageable);
24-
25-
Optional<EmotionRecord> findByRecordId(@Param("recordId") Long recordId);
26-
27-
int deleteByRecordId(@Param("recordId") Long recordId);
15+
void deleteByUser(@Param("user") User user);
2816
}
2917

30-
/**
31-
* @Modifying(clearAutomatically = true)
32-
* 1차 캐시안의 내용까지 지워버리는 옵션
33-
*/
18+
/*
19+
@Modifying(clearAutomatically = true)
20+
1차 캐시안의 내용까지 지워버리는 옵션
21+
*/
22+
3423

0 commit comments

Comments
 (0)