Skip to content

Commit

Permalink
chore : JpaRepository Method Call할 수 있도록 과정수정 및 테스트 샘플 추가 (#13)
Browse files Browse the repository at this point in the history
- Main ComponentScan을 Domain영역 추가
- Domain모듈에서 JPA를 implemention참조가아닌 API참조로 수정
    - 변경한 사유는 implemention인 경우에는 Api모듈에서 JpaRepository인터페이스의 사용이 불가능해지지만, api를 통한 빌드를 할 경우에는 활요이 가능해진다.
- Domain에서 작성해야하는 Entity, Repository의 Sample Code 작성
  • Loading branch information
donsonioc2010 authored Sep 15, 2023
1 parent b9d2dcf commit f488db5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Api/src/main/java/picasso/server/api/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;

import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
// EnableJpaRepositories Reference : https://stackoverflow.com/questions/46732402/spring-boot-autowiring-of-beans-is-not-working-in-maven-multi-module-project
@Slf4j
@EntityScan("picasso.server.domain")
@ComponentScan("picasso.server.domain")
@ComponentScan(basePackages = {"picasso.server"})
@EnableJpaRepositories(basePackages = {"picasso.server.domain"})
@SpringBootApplication
@RequiredArgsConstructor
public class Application {
Expand Down

0 comments on commit f488db5

Please sign in to comment.