Skip to content

[Chore] JPA Entity 작성#13

Merged
chaeyuuu merged 18 commits intomainfrom
chore/#12/jpa-entity
Jul 14, 2025
Merged

[Chore] JPA Entity 작성#13
chaeyuuu merged 18 commits intomainfrom
chore/#12/jpa-entity

Conversation

@yeonju73
Copy link
Copy Markdown
Contributor

@yeonju73 yeonju73 commented Jul 13, 2025

💻 Related Issue

closed #12

🚀 Work Description

스크린샷 2025-07-13 23 44 33
  • ERD를 토대로 JPA Entity 작성하였습니다.
  • global에 BaseEntity 작성하였습니다.
  • JPA Auditing을 적용하여 BaseEntity가 createdAt, updatedAt 을 관리하도록 하였습니다.
  • 모든 엔티티는 BaseEntity를 상속받습니다.
  • 엔티티의 테이블 명은 복수형으로 통일하였습니다.
  • User 엔티티에 양방향 관계 설정하였습니다.
  • User 와 Guardian 엔티티에 @SQLRestriction("deleted_at IS NULL") 설정하여 자동 필터링 도입하였습니다. 현재로는 삭제된 User나 Guardian의 조회가 어떤 기능에서도 필요하지 않은 것으로 생각됩니다.

🙇🏻‍♀️ To Reviewer

스크린샷 2025-07-14 00 02 31
  • 패키지 명과 구조 확인부탁드립니다! 최대한 엔티티명을 따라가면서 가독성이 좋게 만들어봤는데 훈수 부탁드립니다!
  • FraudPhoneNumber와 FraudUrl 엔티티는 oepn api 관련한 유사 로직이 있을 것으로 예상되어 fraud 패키지 하위에 같이 넣었습니다. 헷갈리면 수정하겠습니다.
  • Register api 테스트 해보면서 RegisterRequest dto에 이메일, 생년월일 json 포맷, 전화번호 패턴 검증 어노테이션 추가하였습니다.

@yeonju73 yeonju73 added 🐶 연주 🧹Chore Project maintenance and housekeeping tasks labels Jul 13, 2025
Copy link
Copy Markdown
Contributor

@chaeyuuu chaeyuuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

양 많은데 너무너무 수고하셨습니다! 🥹

FraudPhoneNumber와 FraudUrl 엔티티는 oepn api 관련한 유사 로직이 있을 것으로 예상되어 fraud 패키지 하위에 같이 넣었습니다. 헷갈리면 수정하겠습니다. -> 해당 부분은 구현하면서 분리 필요하다면 리팩토링하면 될 것 같습니다. 크게 문제 없을듯싶습니다!

Comment on lines +15 to +24

@CreatedDate
@Column(name = "created_at", updatable = false, nullable = false)
private LocalDateTime createdAt;

@LastModifiedDate
@Column(name = "updated_at", nullable = false)
private LocalDateTime updatedAt;

}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BaseEntity로 관리하는거 좋습니다!

Comment on lines +24 to +26
@NotBlank
private String password;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

비밀번호 형식은 프론트에서 확인하고 넘겨받으니 따로 체크안하는걸로 이해하면 될까요?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵넵! 중복 체크할 필요없다고 생각했습니담

@AllArgsConstructor
@Builder
@Getter
@SQLRestriction("deleted_at IS NULL")
Copy link
Copy Markdown
Contributor

@chaeyuuu chaeyuuu Jul 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted_at으로 관리하는 것도 좋은데, BaseStatus라는 클래스에서 상태값 Y,N로 관리하는 방식도 있더라고요! 한 번 보시면 좋을 것 같습니담!!

@chaeyuuu chaeyuuu merged commit 24db5e9 into main Jul 14, 2025
@yeonju73 yeonju73 deleted the chore/#12/jpa-entity branch July 17, 2025 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐶 연주 🧹Chore Project maintenance and housekeeping tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Chore] JPA Entity 작성

2 participants