-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
행정구역 목록 조회 API 구현 #47
Conversation
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Entity | ||
@Table(name = "adminitrative_area_sido") | ||
public class Sido extends TimeTrackedBaseEntity{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class Sido extends TimeTrackedBaseEntity{ | |
public class AdministrativeAreaSido extends TimeTrackedBaseEntity{ |
좀 더 길어지긴 하겠지만, 구체적인 이름을 사용하는 편이 좋아보입니다.
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Entity | ||
@Table(name = "adminitrative_area_sido") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s가 빠졌습니다. 오타 수정 부탁드려요.
@Id | ||
@Column(nullable = false, updatable = false) | ||
private Long id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Id | |
@Column(nullable = false, updatable = false) | |
private Long id; | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) | |
@Column(name="administrative_area_sido_id", nullable = false, updatable = false) | |
private Long id; |
- PK 생성 전략은 반드시
IDENTITY
로 설정해주세요. - PK 이름은 ERD대로 설정해주세요.
@Enumerated(EnumType.STRING) | ||
@Column(nullable = false) | ||
private SidoList name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Enumerated(EnumType.STRING) | |
@Column(nullable = false) | |
private SidoList name; | |
@Column(nullable = false) | |
private String name; |
항목이 많지 않고, 수정될 일이 많지 않을 것으로 보여 enum value를 사용하는 것도 좋아보입니다.
다만, 시/군/구와 읍/면/동의 경우 항목이 많고 수정 소요를 고려하여 DB에서 값을 관리해야 할 것 같습니다. 그래서 시/도 역시 마찬가지로 단순 String으로 정의하고, DB에서 값을 관리하면 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit이 "sido 엔티티 작성 및 api 구현"이므로 Emd
class는 commit에 포함시키지 않는 것이 적절해 보입니다. 다음부터는 commit에 관련한 파일만 반영하도록 신경써주세요~ 🙂
e1f6337
to
9aa17a3
Compare
담당 작업자의 git 운영 미숙으로 PR을 닫고 commit 내역을 초기화한다. |
🔥 Related Issue
🏃 Task
📄 Reference