Repository navigation
feat: Phase 8 - JPA and MySQL migration - #12
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 8 — JPA + MySQL 전환 (최종 성공 지표)
메모리 구현체를 JPA/MySQL 구현체로 교체. Phase 1에서 설계한 Repository 인터페이스가 옳았는지 검증하는 단계.
완료한 작업
devqueue데이터베이스 생성spring-boot-starter-data-jpa+ MySQL 드라이버 의존성 추가application-local.properties로 분리 (.gitignore처리,.example템플릿 제공)Article/User/Vocabulary에@Entity/@Id/@GeneratedValue/@Enumerated(STRING)부착SpringDataJpaXxxRepository+JpaXxxRepository(어댑터) 작성@Profile("memory")/@Profile("jpa")로 구현체 전환 가능하게 구성겪은 이슈와 해결
read가 MySQL 예약어와 충돌 —@Column(name = "is_read")로 자바 필드명은 유지하며 DB 컬럼명만 분리ddl-auto=create로 인한 데이터 유실 —update로 변경하여 재시작 시 데이터 보존toggleMemorized,updateMemo,toggleRead,updateArticle,updatePopupDate등 "조회 후 필드만 변경"하는 모든 메서드에@Transactional추가loginUser객체도 직접 갱신하도록 수정학습 개념
@Entity/@Id/@GeneratedValue/@Enumerated(STRING),JpaRepository<T,Long>, Spring Data JPA 쿼리 메서드(findByUsername,findByArticleId자동 구현),@Profile을 통한 구현체 전환,@Transactional과 영속성 컨텍스트/dirty checking, MySQL 예약어 회피완료 기준 (DoD) — 최종 성공 지표
참고
rpi/article-vocab-tracker/plan/PLAN.md(Phase 8)