Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cb462e602f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -0,0 +1,4 @@ | |||
| package com.example.umc10th.domain.member.entity; | |||
|
|
|||
| public class Member { | |||
There was a problem hiding this comment.
JPA 엔티티에 @Entity/@id를 선언하세요
Member가 일반 클래스라서 JPA가 관리하는 엔티티로 인식하지 못하고, 이후 Repository에서 저장/조회 시 Not a managed type 같은 런타임 오류로 바로 막히게 됩니다. 스프링/JPA 학습 관점에서도 엔티티의 최소 조건(식별자, 매핑)을 먼저 잡아야 계층 분리가 제대로 연습됩니다. @Entity와 @Id(필요 시 @GeneratedValue) 및 핵심 필드를 추가하고, API 입출력은 DTO로 분리해 주세요. 다음 단계로는 엔티티 생명주기와 영속성 컨텍스트를 같이 공부하면 좋습니다.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,4 @@ | |||
| package com.example.umc10th.domain.member.repository; | |||
|
|
|||
| public interface MemberRepository { | |||
There was a problem hiding this comment.
Repository를 JpaRepository로 확장하세요
현재 MemberRepository가 빈 인터페이스라서 스프링 데이터 JPA가 기본 CRUD 구현체를 만들어 주지 못하고, 서비스에서 주입/사용하려는 순간 학습 흐름이 끊깁니다(메서드 부재 또는 빈 생성 문제). Repository 계층의 핵심은 인터페이스 선언만으로 쿼리/CRUD를 위임받는 것이므로 JpaRepository<Member, Long>를 상속하고 필요한 쿼리 메서드를 추가하는 형태로 바꾸는 것이 좋습니다. 다음으로는 Spring Data Repository 추상화와 파생 쿼리 메서드 규칙을 공부해 보세요.
Useful? React with 👍 / 👎.
| implementation 'org.springframework.boot:spring-boot-starter-data-jpa' | ||
| implementation 'org.springframework.boot:spring-boot-starter-webmvc' | ||
| compileOnly 'org.projectlombok:lombok' | ||
| runtimeOnly 'com.mysql:mysql-connector-j' |
There was a problem hiding this comment.
JPA 의존성 추가 시 datasource 설정을 함께 넣으세요
JPA와 MySQL 드라이버를 추가했는데 프로젝트에 datasource 설정 파일이 없어 애플리케이션(또는 @SpringBootTest) 시작 시 DataSource 자동구성 단계에서 실패할 가능성이 매우 높습니다. 스프링 부트는 JPA starter가 있으면 DB 연결 구성을 먼저 검증하므로, 학습용 프로젝트라도 실행 가능한 최소 설정이 필요합니다. application.yml(또는 profile별 설정)에 URL/계정 정보를 명시하고, 테스트는 H2나 별도 test profile로 분리해 주세요. 다음으로는 Spring Boot 자동구성 조건과 profile 기반 설정 분리를 학습하면 도움이 됩니다.
Useful? React with 👍 / 👎.
🔗 연관 이슈
closes #29
🛠 작업 내용
🖼 스크린샷 (선택)
👀 리뷰 요구사항 (선택)
🤖 AI 활용
💬 나의 프롬프트
md 파일로 작성한 디렉토리 구조와 erd를 보고서 평가해줘
🧠 AI 응답
✅ 내가 최종 선택한 방법 (이유)
별도의 region, store 도메인을 추가로 만들었다.
거의 첫 스프링 프로젝트이지만, 충분히 논리적이라고 생각했다.
💡 나만의 Tip (선택)