diff --git a/backend/src/main/java/com/now/naaga/player/domain/Player.java b/backend/src/main/java/com/now/naaga/player/domain/Player.java index 30050f4bc..c892c1a62 100644 --- a/backend/src/main/java/com/now/naaga/player/domain/Player.java +++ b/backend/src/main/java/com/now/naaga/player/domain/Player.java @@ -28,7 +28,7 @@ public class Player extends BaseEntity { private Score totalScore; @JoinColumn(name = "member_id") - @OneToOne + @OneToOne(fetch = FetchType.LAZY) private Member member; private boolean deleted = FALSE; diff --git a/backend/src/main/java/com/now/naaga/player/persistence/repository/PlayerRepository.java b/backend/src/main/java/com/now/naaga/player/persistence/repository/PlayerRepository.java index d79fc398f..305cc2fb4 100644 --- a/backend/src/main/java/com/now/naaga/player/persistence/repository/PlayerRepository.java +++ b/backend/src/main/java/com/now/naaga/player/persistence/repository/PlayerRepository.java @@ -3,8 +3,13 @@ import com.now.naaga.player.domain.Player; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; public interface PlayerRepository extends JpaRepository { List findByMemberId(final Long memberId); + + @Override + @Query("SELECT p FROM Player p JOIN FETCH p.member") + List findAll(); } diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml index aee119b31..664a155c0 100644 --- a/backend/src/main/resources/application.yml +++ b/backend/src/main/resources/application.yml @@ -55,6 +55,6 @@ spring: spring: config: - import: classpath:security/application-prod.yml + import: classpath:security/application-local.yml activate: - on-profile: prod + on-profile: local diff --git a/backend/src/main/resources/security b/backend/src/main/resources/security index 02eff9303..f95252b8f 160000 --- a/backend/src/main/resources/security +++ b/backend/src/main/resources/security @@ -1 +1 @@ -Subproject commit 02eff930381a525e4398f1b2fcf2b82c33b0a452 +Subproject commit f95252b8fb6b0766ec8a964f3737e70073863fee diff --git a/backend/src/test/java/com/now/naaga/game/application/HintServiceTest.java b/backend/src/test/java/com/now/naaga/game/application/HintServiceTest.java index 7c27b0c3e..781c518ff 100644 --- a/backend/src/test/java/com/now/naaga/game/application/HintServiceTest.java +++ b/backend/src/test/java/com/now/naaga/game/application/HintServiceTest.java @@ -26,6 +26,7 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ActiveProfiles; import org.springframework.test.context.jdbc.Sql; +import org.springframework.transaction.annotation.Transactional; @SuppressWarnings("NonAsciiCharacters") @DisplayNameGeneration(ReplaceUnderscores.class) @@ -42,6 +43,7 @@ class HintServiceTest { @Autowired private PlaceBuilder placeBuilder; + @Transactional @Test void 힌트를_생성한다() { // given